I'am curious about compute shader in OpenGL.
Let's assume the number of points (vec4) is 900
and the work group size(= the number of work items) is 256
Then, We would have four work groups because 900/256 = 3.xx, so need to plus 1.
The code is as follows:
glDispatchCompute(4, 1, 1);
and shader is as follows:
layout(local_size_x = 256, local_size_y = 1, local_size_z = 1) in;
layout(std430, binding = 0) buffer Particles {
vec4 partices[];
};
In this case, I wonder how to work fourth work group. In my thought, the fourth work group have overflow problem because the total number of points is 900.
Do we need to deal exceptional case(overflow)?
For example, if idex > total num, then 'pass'
Or
The Opengl deals this problem automatically?
(ex, There is no problem situation.)
I tried to check by myself. Even though I make overflow situation, there was no warning.