From 562cb8381e4545621aa1c310e16b7439ad3e6b4c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 22 Mar 2024 15:19:06 -0400 Subject: [PATCH] zink: track a mask of arrayed io locations on shaders Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 10 ++++++++-- src/gallium/drivers/zink/zink_types.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index e1ed6186176..fd569c66111 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -4652,10 +4652,16 @@ scan_nir(struct zink_screen *screen, nir_shader *shader, struct zink_shader *zs) bool is_load = false; bool is_input = false; bool is_interp = false; - /* TODO: delete this once #10826 is fixed */ if (filter_io_instr(intr, &is_load, &is_input, &is_interp)) { + nir_io_semantics s = nir_intrinsic_io_semantics(intr); + if (io_instr_is_arrayed(intr) && s.location < VARYING_SLOT_PATCH0) { + if (is_input) + zs->arrayed_inputs |= BITFIELD64_BIT(s.location); + else + zs->arrayed_outputs |= BITFIELD64_BIT(s.location); + } + /* TODO: delete this once #10826 is fixed */ if (!(is_input && shader->info.stage == MESA_SHADER_VERTEX)) { - nir_io_semantics s = nir_intrinsic_io_semantics(intr); if (is_clipcull_dist(s.location)) { unsigned frac = nir_intrinsic_component(intr) + 1; if (s.location < VARYING_SLOT_CULL_DIST0) { diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index d0c502be52a..9fb20dca525 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -818,6 +818,8 @@ struct zink_shader { unsigned num_texel_buffers; uint32_t ubos_used; // bitfield of which ubo indices are used uint32_t ssbos_used; // bitfield of which ssbo indices are used + uint64_t arrayed_inputs; //mask of locations using arrayed io + uint64_t arrayed_outputs; //mask of locations using arrayed io uint64_t flat_flags; bool bindless; bool can_inline;