From 997b3ebbdbf121e10cd675ae9235e14b1f9b7445 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 10 Nov 2025 12:59:27 -0500 Subject: [PATCH] poly: fix cull distance More fallout from strict NIR validation but easy to fix. I hit this when attempting to CTS changes for parent_instr. Closes: #14245 Fixes: 2f6b4803abe ("nir/validate: expand IO intrinsic validation with nir_io_semantics") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/poly/nir/poly_nir_lower_gs.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/poly/nir/poly_nir_lower_gs.c b/src/poly/nir/poly_nir_lower_gs.c index 4a978420c2d..2e178362730 100644 --- a/src/poly/nir/poly_nir_lower_gs.c +++ b/src/poly/nir/poly_nir_lower_gs.c @@ -795,14 +795,6 @@ create_gs_rast_shader(const nir_shader *gs, const struct lower_gs_state *state) assert(rs.selected.outputs[slot] != NULL); nir_def *value = nir_load_var(b, rs.selected.outputs[slot]); - /* We set NIR_COMPACT_ARRAYS so clip/cull distance needs to come all in - * DIST0. Undo the offset if we need to. - */ - assert(slot != VARYING_SLOT_CULL_DIST1); - unsigned offset = 0; - if (slot == VARYING_SLOT_CLIP_DIST1) - offset = 1; - /* We must only rasterize vertices from the rasterization stream. Since we * shade vertices across all streams, we do this by throwing away vertices * from non-rasterization streams (by setting a component to NaN). @@ -816,8 +808,8 @@ create_gs_rast_shader(const nir_shader *gs, const struct lower_gs_state *state) nir_bcsel(b, nir_ieq(b, rs.stream, rast_stream), value, killed); } - nir_store_output(b, value, nir_imm_int(b, offset), - .io_semantics.location = slot - offset); + nir_store_output(b, value, nir_imm_int(b, 0), + .io_semantics.location = slot); } /* The geometry shader might not write point size - ensure it does, if we're