mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
glsl/nir/linker: Also remove image variables
If we don't, then the array shrinker may shrink them to an array of zero
images which can cause GLSL serialization to blow up but only the next
time the GLSL shader is loaded from the disk cache.
Fixes: b8ee37472d ("glsl: Use nir_var_mem_image for images")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5520
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13412>
This commit is contained in:
parent
0a277fabce
commit
0bbb32ece4
1 changed files with 4 additions and 2 deletions
|
|
@ -606,7 +606,8 @@ gl_nir_link_spirv(struct gl_context *ctx, struct gl_shader_program *prog,
|
||||||
const nir_remove_dead_variables_options opts = {
|
const nir_remove_dead_variables_options opts = {
|
||||||
.can_remove_var = can_remove_uniform,
|
.can_remove_var = can_remove_uniform,
|
||||||
};
|
};
|
||||||
nir_remove_dead_variables(shader->Program->nir, nir_var_uniform,
|
nir_remove_dead_variables(shader->Program->nir,
|
||||||
|
nir_var_uniform | nir_var_image,
|
||||||
&opts);
|
&opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -670,7 +671,8 @@ gl_nir_link_glsl(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||||
const nir_remove_dead_variables_options opts = {
|
const nir_remove_dead_variables_options opts = {
|
||||||
.can_remove_var = can_remove_uniform,
|
.can_remove_var = can_remove_uniform,
|
||||||
};
|
};
|
||||||
nir_remove_dead_variables(shader->Program->nir, nir_var_uniform,
|
nir_remove_dead_variables(shader->Program->nir,
|
||||||
|
nir_var_uniform | nir_var_image,
|
||||||
&opts);
|
&opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue