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>
This commit is contained in:
parent
7fa0250f94
commit
5fe912831c
|
@ -442,6 +442,7 @@ void
|
||||||
_mesa_bind_pipeline(struct gl_context *ctx,
|
_mesa_bind_pipeline(struct gl_context *ctx,
|
||||||
struct gl_pipeline_object *pipe)
|
struct gl_pipeline_object *pipe)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
/* First bind the Pipeline to pipeline binding point */
|
/* First bind the Pipeline to pipeline binding point */
|
||||||
_mesa_reference_pipeline_object(ctx, &ctx->Pipeline.Current, pipe);
|
_mesa_reference_pipeline_object(ctx, &ctx->Pipeline.Current, pipe);
|
||||||
|
|
||||||
|
@ -467,6 +468,9 @@ _mesa_bind_pipeline(struct gl_context *ctx,
|
||||||
|
|
||||||
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
|
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
|
||||||
|
|
||||||
|
for (i = 0; i < MESA_SHADER_STAGES; i++)
|
||||||
|
_mesa_shader_program_init_subroutine_defaults(ctx->_Shader->CurrentProgram[i]);
|
||||||
|
|
||||||
if (ctx->Driver.UseProgram)
|
if (ctx->Driver.UseProgram)
|
||||||
ctx->Driver.UseProgram(ctx, NULL);
|
ctx->Driver.UseProgram(ctx, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1132,6 +1132,9 @@ use_shader_program(struct gl_context *ctx, gl_shader_stage stage,
|
||||||
if ((shProg != NULL) && (shProg->_LinkedShaders[stage] == NULL))
|
if ((shProg != NULL) && (shProg->_LinkedShaders[stage] == NULL))
|
||||||
shProg = NULL;
|
shProg = NULL;
|
||||||
|
|
||||||
|
if (shProg)
|
||||||
|
_mesa_shader_program_init_subroutine_defaults(shProg);
|
||||||
|
|
||||||
if (*target != shProg) {
|
if (*target != shProg) {
|
||||||
/* Program is current, flush it */
|
/* Program is current, flush it */
|
||||||
if (shTarget == ctx->_Shader) {
|
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);
|
use_shader_program(ctx, i, shProg, &ctx->Shader);
|
||||||
_mesa_active_program(ctx, shProg, "glUseProgram");
|
_mesa_active_program(ctx, shProg, "glUseProgram");
|
||||||
|
|
||||||
_mesa_shader_program_init_subroutine_defaults(shProg);
|
|
||||||
if (ctx->Driver.UseProgram)
|
if (ctx->Driver.UseProgram)
|
||||||
ctx->Driver.UseProgram(ctx, shProg);
|
ctx->Driver.UseProgram(ctx, shProg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue