From f89b29f708cbc8140f3a5f4520f5dd4e5d402e0d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 11 Nov 2020 13:44:47 -0800 Subject: [PATCH] prog_to_nir: Revert name initialization change Commit eda3e4e055e240a14c6ad4bdbde544c6348fc01d moved the creation of s->info.name to shader creation time, rather than after the compile. A few lines after creating the shader, prog_to_nir clobbers s->info entirely, losing the name. This dropped the "ARB" indicator that iris uses to switch math to the legacy non-IEEE mode used by ARB_vertex_program/fragment_program. Revert that hunk and go back to doing things the way they were. Fixes: eda3e4e055e ("nir/builder: Add a name format arg to nir_builder_init_simple_shader().") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3777 Acked-by: Caio Marcelo de Oliveira Filho Part-of: --- src/mesa/program/prog_to_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 8ce77a684da..cde4de2ec7d 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -969,8 +969,7 @@ prog_to_nir(const struct gl_program *prog, return NULL; c->prog = prog; - c->build = nir_builder_init_simple_shader(stage, options, - "ARB%d", prog->Id); + c->build = nir_builder_init_simple_shader(stage, options, NULL); /* Copy the shader_info from the gl_program */ c->build.shader->info = prog->info; @@ -998,6 +997,7 @@ prog_to_nir(const struct gl_program *prog, ptn_add_output_stores(c); + s->info.name = ralloc_asprintf(s, "ARB%d", prog->Id); s->info.num_textures = util_last_bit(prog->SamplersUsed); s->info.num_ubos = 0; s->info.num_abos = 0;