From 8e93e7cd727bf8cd91fdc4d82a53b0d2ad5e3df3 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 9 Sep 2025 13:50:12 +0300 Subject: [PATCH] brw: layout patch in VUE in position independent way Only if required. I somehow misunderstood that those would need to be independent too, not just the vertex slots. Signed-off-by: Lionel Landwerlin Fixes: 8dee4813b0 ("brw: add ability to compute VUE map for separate tcs/tes") Acked-by: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/ci/zink-anv-adl-fails.txt | 1 - src/intel/compiler/brw_vue_map.c | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/zink/ci/zink-anv-adl-fails.txt b/src/gallium/drivers/zink/ci/zink-anv-adl-fails.txt index fa792469c28..b84f646f84a 100644 --- a/src/gallium/drivers/zink/ci/zink-anv-adl-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-anv-adl-fails.txt @@ -670,6 +670,5 @@ wayland-dEQP-EGL.functional.resize.surface_size.stretch_width,Fail # shader objects #13839 KHR-GL46.separable_programs_tf.tessellation_active,Fail spec@arb_fragment_program@fog-modes,Crash -spec@arb_separate_shader_objects@mix-and-match-tcs-tes,Fail spec@arb_occlusion_query@occlusion_query_meta_fragments,Fail spec@arb_occlusion_query@occlusion_query_meta_save,Fail diff --git a/src/intel/compiler/brw_vue_map.c b/src/intel/compiler/brw_vue_map.c index 0e69a968827..cf3ad12ece9 100644 --- a/src/intel/compiler/brw_vue_map.c +++ b/src/intel/compiler/brw_vue_map.c @@ -352,12 +352,14 @@ brw_compute_tess_vue_map(struct intel_vue_map *vue_map, assign_vue_slot(vue_map, VARYING_SLOT_TESS_LEVEL_OUTER, slot++); /* first assign per-patch varyings */ - while (patch_slots != 0) { - const int varying = ffsll(patch_slots) - 1; - if (vue_map->varying_to_slot[varying + VARYING_SLOT_PATCH0] == -1) { - assign_vue_slot(vue_map, varying + VARYING_SLOT_PATCH0, slot++); + const int first_patch_slot = slot; + u_foreach_bit64(patch, patch_slots) { + if (separate) { + slot = first_patch_slot + patch; + assign_vue_slot(vue_map, VARYING_SLOT_PATCH0 + patch, slot++); + } else { + assign_vue_slot(vue_map, VARYING_SLOT_PATCH0 + patch, slot++); } - patch_slots &= ~BITFIELD64_BIT(varying); } /* apparently, including the patch header... */