summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index b042c86f939..7f4212333f1 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2929,7 +2929,8 @@ get_mesa_program(struct gl_context *ctx,
prog->info.fs.depth_layout = shader_program->FragDepthLayout;
}
- _mesa_reference_program(ctx, &shader->Program, prog);
+ /* Don't use _mesa_reference_program() just take ownership */
+ shader->Program = prog;
if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0) {
_mesa_optimize_program(ctx, prog, prog);
@@ -3033,11 +3034,11 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
if (!ctx->Driver.ProgramStringNotify(ctx,
_mesa_shader_stage_to_program(i),
linked_prog)) {
+ _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
+ NULL);
return GL_FALSE;
}
}
-
- _mesa_reference_program(ctx, &linked_prog, NULL);
}
build_program_resource_list(ctx, prog);