diff options
| author | Faith Ekstrand <faith.ekstrand@collabora.com> | 2025-11-05 12:04:40 -0500 |
|---|---|---|
| committer | Marge Bot <marge-bot@fdo.invalid> | 2025-11-06 14:57:31 +0000 |
| commit | 0ccadf7a86510b5325294a856520c7243bd3071e (patch) | |
| tree | faf707e8629a173bc48faf6805ae93d1ab4e5020 | |
| parent | 5ed35866c25c3c38ed9948620b17b376a9b5947e (diff) | |
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>
| -rw-r--r-- | src/compiler/nir/nir_lower_point_size.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_point_size.c b/src/compiler/nir/nir_lower_point_size.c index fbb93b8536d..3d0a9271d09 100644 --- a/src/compiler/nir/nir_lower_point_size.c +++ b/src/compiler/nir/nir_lower_point_size.c @@ -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 || |