diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 4e77b32..66d21bc 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -129,14 +129,18 @@ _mesa_GetActiveUniformsiv(GLuint program, res_prop = resource_prop_from_uniform_prop(pname); + /* We need to first verify that each entry exists as active uniform. */ for (int i = 0; i < uniformCount; i++) { - res = _mesa_program_resource_find_index(shProg, GL_UNIFORM, - uniformIndices[i]); - if (!res) { + if (!_mesa_program_resource_find_index(shProg, GL_UNIFORM, + uniformIndices[i])) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformsiv(index)"); - break; + return; } + } + for (int i = 0; i < uniformCount; i++) { + res = _mesa_program_resource_find_index(shProg, GL_UNIFORM, + uniformIndices[i]); if (!_mesa_program_resource_prop(shProg, res, uniformIndices[i], res_prop, ¶ms[i], "glGetActiveUniformsiv"))