According to OpenGL specs 4.5, bool
in std140 layout block reserve 1 byte (sizeof(GLboolean) == 1
).
But when I get the offset of b
, it is 4.
Where is the misunderstanding?
layout (std140) uniform Uniforms
{
bool a;
bool b;
};
The following structure expands 4 bytes to 64. Why engineers created a so super resource-wasted standard?
layout (std140) uniform Uniforms
{
bool a[4];
};