summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/r600/r600_shader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index a6b9f94f9cb..532c25ec2f9 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -195,6 +195,8 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
goto error;
}
} else {
+ glsl_type_singleton_init_or_ref();
+
if (sel->ir_type == PIPE_SHADER_IR_TGSI) {
if (sel->nir)
ralloc_free(sel->nir);
@@ -216,6 +218,9 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
nir_tgsi_scan_shader(sel->nir, &sel->info, true);
r = r600_shader_from_nir(rctx, shader, &key);
+
+ glsl_type_singleton_decref();
+
if (r) {
fprintf(stderr, "--Failed shader--------------------------------------------------\n");