mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 12:50:10 +01:00
mesa: fix glGetActiveUniformsiv regression
Commit 7519ddb caused regression to glGetActiveUniformsiv.
Patch adds back validation loop of all given uniforms before
writing any values, not touching params in case of errors
is tested by the conformance suite.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90149
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
This commit is contained in:
parent
a563689a40
commit
18f44d3030
1 changed files with 17 additions and 5 deletions
|
|
@ -129,14 +129,26 @@ _mesa_GetActiveUniformsiv(GLuint program,
|
|||
|
||||
res_prop = resource_prop_from_uniform_prop(pname);
|
||||
|
||||
/* We need to first verify that each entry exists as active uniform. If
|
||||
* not, generate error and do not cause any other side effects.
|
||||
*
|
||||
* In the case of and error condition, Page 16 (section 2.3.1 Errors)
|
||||
* of the OpenGL 4.5 spec says:
|
||||
*
|
||||
* "If the generating command modifies values through a pointer argu-
|
||||
* ment, no change is made to these values."
|
||||
*/
|
||||
for (int i = 0; i < uniformCount; i++) {
|
||||
if (!_mesa_program_resource_find_index(shProg, GL_UNIFORM,
|
||||
uniformIndices[i])) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformsiv(index)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < uniformCount; i++) {
|
||||
res = _mesa_program_resource_find_index(shProg, GL_UNIFORM,
|
||||
uniformIndices[i]);
|
||||
if (!res) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformsiv(index)");
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_mesa_program_resource_prop(shProg, res, uniformIndices[i],
|
||||
res_prop, ¶ms[i],
|
||||
"glGetActiveUniformsiv"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue