mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
glsl: raise GL_INVALID_OPERATION for glUniform(location < -1)
location = -1 is silently ignored, but other negative values should raise an error. Another fix for bug 20056.
This commit is contained in:
parent
4ef7a93296
commit
234f03e90a
1 changed files with 10 additions and 0 deletions
|
|
@ -1700,6 +1700,11 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
|
|||
if (location == -1)
|
||||
return; /* The standard specifies this as a no-op */
|
||||
|
||||
if (location < -1) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)");
|
||||
return;
|
||||
}
|
||||
|
||||
split_location_offset(&location, &offset);
|
||||
|
||||
if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
|
||||
|
|
@ -1874,6 +1879,11 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
|
|||
if (location == -1)
|
||||
return; /* The standard specifies this as a no-op */
|
||||
|
||||
if (location < -1) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)");
|
||||
return;
|
||||
}
|
||||
|
||||
split_location_offset(&location, &offset);
|
||||
|
||||
if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue