summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pipelineobj.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-01-09 16:13:28 +1100
committerTimothy Arceri <[email protected]>2017-01-19 15:55:02 +1100
commitaad93402c00ae90274d7abdbb64960d9ae40a0ce (patch)
tree7c597e71dab97a70c9c0fc3529039a65387172b6 /src/mesa/main/pipelineobj.c
parent90d950038f801551cc5b939ef31c379bccf96f5f (diff)
mesa: change init subroutine defaults helper to work per gl_program
A later patch will result in SSO programs calling this helper per gl_program rather than per gl_shader_program. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/mesa/main/pipelineobj.c')
-rw-r--r--src/mesa/main/pipelineobj.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 9651a40dbb8..e777f991589 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -468,8 +468,14 @@ _mesa_bind_pipeline(struct gl_context *ctx,
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
- for (i = 0; i < MESA_SHADER_STAGES; i++)
- _mesa_shader_program_init_subroutine_defaults(ctx, ctx->_Shader->CurrentProgram[i]);
+ for (i = 0; i < MESA_SHADER_STAGES; i++) {
+ if (ctx->_Shader->CurrentProgram[i]) {
+ struct gl_linked_shader *sh =
+ ctx->_Shader->CurrentProgram[i]->_LinkedShaders[i];
+ if (sh)
+ _mesa_program_init_subroutine_defaults(ctx, sh->Program);
+ }
+ }
}
}