mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 14:18:07 +02:00
i965: keep gl_program shader info in sync after gather info
It's possible that nir_shader was cloned and it no longer contains a pointer to the shader_info in gl_program. So we need to copy shader_info back to gl_program if that is the case. Fixes a regression with NIR_TEST_CLONE=true Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98840
This commit is contained in:
parent
ee1f35eb69
commit
f562b13bc7
2 changed files with 11 additions and 2 deletions
|
|
@ -64,7 +64,7 @@ brw_nir_lower_uniforms(nir_shader *nir, bool is_scalar)
|
|||
nir_shader *
|
||||
brw_create_nir(struct brw_context *brw,
|
||||
const struct gl_shader_program *shader_prog,
|
||||
const struct gl_program *prog,
|
||||
struct gl_program *prog,
|
||||
gl_shader_stage stage,
|
||||
bool is_scalar)
|
||||
{
|
||||
|
|
@ -107,6 +107,15 @@ brw_create_nir(struct brw_context *brw,
|
|||
|
||||
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
|
||||
|
||||
/* nir_shader may have been cloned so make sure shader_info is in sync */
|
||||
if (nir->info != &prog->info) {
|
||||
const char *name = prog->info.name;
|
||||
const char *label = prog->info.label;
|
||||
prog->info = *nir->info;
|
||||
prog->info.name = name;
|
||||
prog->info.label = label;
|
||||
}
|
||||
|
||||
if (shader_prog) {
|
||||
NIR_PASS_V(nir, nir_lower_samplers, shader_prog);
|
||||
NIR_PASS_V(nir, nir_lower_atomics, shader_prog);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct brw_context;
|
|||
|
||||
struct nir_shader *brw_create_nir(struct brw_context *brw,
|
||||
const struct gl_shader_program *shader_prog,
|
||||
const struct gl_program *prog,
|
||||
struct gl_program *prog,
|
||||
gl_shader_stage stage,
|
||||
bool is_scalar);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue