diff options
author | Gert Wollny <gert.wollny@collabora.com> | 2022-11-20 17:32:21 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-11-21 10:43:51 +0000 |
commit | a69eafc4226479fc143807a3a0c2ce52a3bc3939 (patch) | |
tree | 76b196e01356afe8db092d79a27a329746aad82a /src/gallium/drivers | |
parent | 089ae08ab1f2c8035680013fe267b049777c2d1b (diff) |
r600: reference glsl type system during translation
VL doesn't initialize the type systen, but creates shaders in TGSI.
When these are translated to NIR and then compiled in the driver
we need to have a reference to the glsl type system.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7453
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19883>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 5 |
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"); |