summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-17 16:25:02 +1000
committerDave Airlie <airlied@redhat.com>2016-05-23 16:19:57 +1000
commit5fe912831cac6722f2cf8add010c553a43e178b4 (patch)
treed925e544361c9530a5e9007c9199d89d2b05b91a /src/mesa/main/shaderapi.c
parent7fa0250f9446ec57caab581b8cac2c011c1cb497 (diff)
mesa/subroutines: fix reset on bindpipeline
Fixes: GL45-CTS.shader_subroutine.subroutine_uniform_reset Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 79097679e90..6d58fbb492e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1132,6 +1132,9 @@ use_shader_program(struct gl_context *ctx, gl_shader_stage stage,
if ((shProg != NULL) && (shProg->_LinkedShaders[stage] == NULL))
shProg = NULL;
+ if (shProg)
+ _mesa_shader_program_init_subroutine_defaults(shProg);
+
if (*target != shProg) {
/* Program is current, flush it */
if (shTarget == ctx->_Shader) {
@@ -1176,7 +1179,6 @@ _mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg)
use_shader_program(ctx, i, shProg, &ctx->Shader);
_mesa_active_program(ctx, shProg, "glUseProgram");
- _mesa_shader_program_init_subroutine_defaults(shProg);
if (ctx->Driver.UseProgram)
ctx->Driver.UseProgram(ctx, shProg);
}