mesa: fix crashes in the no_error path of glUniform

Fixes: bd2662bfa1 - mesa: add KHR_no_error support to glUniform*() functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13417>
(cherry picked from commit 03186773a6)
This commit is contained in:
Marek Olšák 2021-10-18 12:39:08 -04:00 committed by Dylan Baker
parent 81d4f432a9
commit 2c7e1a9060
2 changed files with 4 additions and 2 deletions

View file

@ -256,7 +256,7 @@
"description": "mesa: fix crashes in the no_error path of glUniform",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bd2662bfa1c8746dc29a7bad32a1647379f78532"
},

View file

@ -1280,7 +1280,7 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
return;
uni = shProg->UniformRemapTable[location];
if (!uni)
if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
return;
/* The array index specified by the uniform location is just the
@ -1846,6 +1846,8 @@ _mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values,
return;
uni = shProg->UniformRemapTable[location];
if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
return;
/* The array index specified by the uniform location is just the
* uniform location minus the base location of of the uniform.