I am trying to understand a segmentation fault in my compute shader.
I reduced the shader code to a minimum while still producing the seg fault:
#version 460
layout(binding = 0) buffer Layers {
uint offsets[];
};
layout(binding = 1) buffer Data {
float data[];
};
layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main()
{
for (uint i=0; i>=0; i--) {
data[offsets[i]] = 1;
}
}
I don’t understand why the code executes without seg fault if I change the for loop to:
for (uint i=0; i<=0; i++)
Both versions should produce a single iteration with i == 0.