arb_shader_subroutine: check active subroutine limit
_mesa_GetActiveSubroutineUniformiv needs to check against the number of types here. Noticed while playing with ogl conform. Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
74e71cbfcb
commit
ba3414d832
|
@ -2369,6 +2369,11 @@ _mesa_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype,
|
|||
return;
|
||||
}
|
||||
|
||||
if (index >= sh->NumSubroutineUniformTypes) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s: invalid index greater than GL_ACTIVE_SUBROUTINE_UNIFORMS", api_name);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pname) {
|
||||
case GL_NUM_COMPATIBLE_SUBROUTINES: {
|
||||
res = _mesa_program_resource_find_index(shProg, resource_type, index);
|
||||
|
|
Loading…
Reference in New Issue