mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
mesa: glsl: fix error check in get_uniformfv()
(cherry picked from commit 18cd9c229a)
This commit is contained in:
parent
452a592ca4
commit
bda6ad273d
1 changed files with 9 additions and 4 deletions
|
|
@ -50,6 +50,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef GL_PROGRAM_BINARY_LENGTH_OES
|
||||||
|
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a new gl_shader_program object, initialize it.
|
* Allocate a new gl_shader_program object, initialize it.
|
||||||
*/
|
*/
|
||||||
|
|
@ -929,6 +934,9 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
|
||||||
if (*params > 0)
|
if (*params > 0)
|
||||||
(*params)++; /* add one for terminating zero */
|
(*params)++; /* add one for terminating zero */
|
||||||
break;
|
break;
|
||||||
|
case GL_PROGRAM_BINARY_LENGTH_OES:
|
||||||
|
*params = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1022,7 +1030,7 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
|
||||||
GLfloat *params)
|
GLfloat *params)
|
||||||
{
|
{
|
||||||
struct gl_shader_program *shProg
|
struct gl_shader_program *shProg
|
||||||
= _mesa_lookup_shader_program(ctx, program);
|
= _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v");
|
||||||
if (shProg) {
|
if (shProg) {
|
||||||
if (shProg->Uniforms &&
|
if (shProg->Uniforms &&
|
||||||
location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) {
|
location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) {
|
||||||
|
|
@ -1056,9 +1064,6 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
|
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue