mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 22:20:09 +01:00
nir: Check the deref mode in lower_point_size()
This is more robust because it ensures that we only ever check the location on something that we know is an outupt. Also, if it's an output then we know (thanks, validation!) that it's a variable. Reviewed-by: Olivia Lee <olivia.lee@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265>
This commit is contained in:
parent
5ed35866c2
commit
0ccadf7a86
1 changed files with 2 additions and 2 deletions
|
|
@ -42,10 +42,10 @@ lower_point_size_intrin(nir_builder *b, nir_intrinsic_instr *intr, void *data)
|
|||
|
||||
if (intr->intrinsic == nir_intrinsic_store_deref) {
|
||||
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
|
||||
nir_variable *var = nir_deref_instr_get_variable(deref);
|
||||
if (!var)
|
||||
if (!nir_deref_mode_is(deref, nir_var_shader_out))
|
||||
return false;
|
||||
|
||||
nir_variable *var = nir_deref_instr_get_variable(deref);
|
||||
location = var->data.location;
|
||||
psiz_src = &intr->src[1];
|
||||
} else if (intr->intrinsic == nir_intrinsic_store_output ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue