There is a bool type for shader variables I’d like to use, but I couldn’t find what size it have. This matters because when setting up vertex attribute pointer I specify the type of data which can be
GL_BYTE,
GL_UNSIGNED_BYTE,
GL_SHORT,
GL_UNSIGNED_SHORT,
GL_INT,
GL_UNSIGNED_INT,
GL_FLOAT, or
GL_DOUBLE
In c++ generally bool should have the same size as 4 byte int, but can I assume the same for GLSL or does it have only 1 byte?
It’s irrelevant, since vertex attributes cannot be booleans. From the GLSL 3.30 specification:
Booleans are not on that list.
However, if you want to know what the size of a GLSL
boolis in terms of uniform blocks, it has the same size asuint: 32-bits.