cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
538 stars 59 forks source link

Program::get() does not support GL_COMPUTE_WORK_GROUP_SIZE #354

Closed paslange closed 6 years ago

paslange commented 7 years ago

The current signature of Program::get() returns a single integer, but glGetProgramiv() would return three values if GL_COMPUTE_WORK_GROUP_SIZE is passed as pname.

Additionally, the implementation of Program::get() assumes, that glGetProgramiv() writes a single value only, so that the stack will be corrupted if multiple integers are written. As far as I have seen, only GL_COMPUTE_WORK_GROUP_SIZE queries more than one integer.

scheibel commented 6 years ago

Thanks for reporting. You may now use program->get<3>(GL_COMPUTE_WORK_GROUP_SIZE) to query the work group sizes for compute programs.