Query the local_size values declared in a shader

Viewed 58

OpenGL Compute Shader declare their expected workGroup size using local_size lines like those

layout (local_size_x = 128, local_size_y = 1, local_size_z = 1) in;

later, the C++ program that executes the shader whould call the glDispatchCompute

glDispatchCompute(numWorkItems / workGroupSize, 1, 1);

where workGroupSize should be exactly 128 or else bad things are going to happen. This mean that modifying the shader source needs to modify the also the C++.

The question is if there a way to query the which are the values declared in the shader after it has been compiled and linked into a glProgram. Of course, I know the GLuint values used in the call to glAttachShader(programID, shaderID); function.

1 Answers
Related