prog_to_nir: Revert name initialization change

Commit eda3e4e055 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: eda3e4e055 ("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 <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7564>
This commit is contained in:
Kenneth Graunke
2020-11-11 13:44:47 -08:00
parent 2009258796
commit f89b29f708

View File

@@ -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;