From 0ccadf7a86510b5325294a856520c7243bd3071e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 5 Nov 2025 12:04:40 -0500 Subject: 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 Part-of: --- src/compiler/nir/nir_lower_point_size.c | 4 ++-- 1 file 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 || -- cgit v1.2.3