diff --git a/src/compiler/nir/nir_shader_from_string.c b/src/compiler/nir/nir_shader_from_string.c index 20d34a048256f1cdc38e33a091cd2b50625f7bf8..a2627471f076f56a28d4dfe0e46f3e2f568ecde2 100644 --- a/src/compiler/nir/nir_shader_from_string.c +++ b/src/compiler/nir/nir_shader_from_string.c @@ -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 = shader_dup; + glsl_type_singleton_init_or_ref(); + gl_shader_stage stage = get_stage(shader); nir_builder_init_simple_shader(&b, NULL, stage, options); shader = next_line(shader); @@ -1708,5 +1710,6 @@ fail: if (!retval) ralloc_free(b.shader); free(shader_dup); + glsl_type_singleton_decref(); return retval; }