mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
radv: remove NIR_PASS in insert_rt_case
When NIR_DEBUG=serialize or NIR_DEBUG=clone is used, NIR_PASS recreates nir_function_impl and nir_variable objects, causing use-after-free since insert_rt_case() keeps pointers to those in local variables and var_remap. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37573>
This commit is contained in:
parent
55018df38d
commit
241bbb4977
1 changed files with 4 additions and 3 deletions
|
|
@ -831,10 +831,11 @@ insert_rt_case(nir_builder *b, nir_shader *shader, struct rt_variables *vars, ni
|
|||
struct rt_variables src_vars = create_rt_variables(shader, vars->device, vars->flags, vars->monolithic);
|
||||
map_rt_variables(var_remap, &src_vars, vars);
|
||||
|
||||
NIR_PASS(_, shader, lower_rt_instructions, &src_vars, false, NULL);
|
||||
/* These can't use NIR_PASS because NIR_DEBUG=serialize,clone invalidates pointers. */
|
||||
lower_rt_instructions(shader, &src_vars, false, NULL);
|
||||
|
||||
NIR_PASS(_, shader, nir_lower_returns);
|
||||
NIR_PASS(_, shader, nir_opt_dce);
|
||||
nir_lower_returns(shader);
|
||||
nir_opt_dce(shader);
|
||||
|
||||
inline_constants(b->shader, shader);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue