Commit 34c4da0c authored by Gert Wollny's avatar Gert Wollny

nir_shader_from_string: ref and deref type singleton

parent d7231b92
...@@ -1677,6 +1677,8 @@ nir_shader *nir_shader_from_string(const char *sh, const nir_shader_compiler_opt ...@@ -1677,6 +1677,8 @@ nir_shader *nir_shader_from_string(const char *sh, const nir_shader_compiler_opt
char *shader_dup = strdup(sh); char *shader_dup = strdup(sh);
char *shader = shader_dup; char *shader = shader_dup;
glsl_type_singleton_init_or_ref();
gl_shader_stage stage = get_stage(shader); gl_shader_stage stage = get_stage(shader);
nir_builder_init_simple_shader(&b, NULL, stage, options); nir_builder_init_simple_shader(&b, NULL, stage, options);
shader = next_line(shader); shader = next_line(shader);
...@@ -1708,5 +1710,6 @@ fail: ...@@ -1708,5 +1710,6 @@ fail:
if (!retval) if (!retval)
ralloc_free(b.shader); ralloc_free(b.shader);
free(shader_dup); free(shader_dup);
glsl_type_singleton_decref();
return retval; return retval;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment