From a0f6fecc6afeccc8e149ab31769df8b5225faa16 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 7 Apr 2022 10:14:10 -0400 Subject: [PATCH] zink: flag all assigned output slots as mapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this ensures types which consume more than 1 slot are effectively tagged so that the next stage inputs are also assigned properly fixes: spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-dvec3 cc: mesa-stable Reviewed-by: Timur Kristóf Part-of: --- src/gallium/drivers/zink/ci/zink-lvp-fails.txt | 1 - src/gallium/drivers/zink/ci/zink-radv-fails.txt | 1 - src/gallium/drivers/zink/zink_compiler.c | 11 +++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/zink/ci/zink-lvp-fails.txt b/src/gallium/drivers/zink/ci/zink-lvp-fails.txt index b89c86d2e0c..30e473e51d3 100644 --- a/src/gallium/drivers/zink/ci/zink-lvp-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-lvp-fails.txt @@ -216,7 +216,6 @@ spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index,Fail spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non-const-uniform-index2,Fail spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail -spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-dvec3,Fail spec@arb_fragment_program_shadow@tex-shadow1d,Fail spec@arb_fragment_program_shadow@tex-shadow2d,Fail spec@arb_fragment_program_shadow@tex-shadow2drect,Fail diff --git a/src/gallium/drivers/zink/ci/zink-radv-fails.txt b/src/gallium/drivers/zink/ci/zink-radv-fails.txt index 08813fe5498..c8d70faf609 100644 --- a/src/gallium/drivers/zink/ci/zink-radv-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-radv-fails.txt @@ -55,7 +55,6 @@ spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-mixed-const-non spec@arb_arrays_of_arrays@execution@image_store@basic-imagestore-non-const-uniform-index,Fail spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash spec@arb_depth_texture@depth-tex-modes,Fail -spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-dvec3,Fail spec@arb_fragment_program_shadow@tex-shadow1d,Fail spec@arb_fragment_program_shadow@tex-shadow2d,Fail spec@arb_fragment_program_shadow@tex-shadow2drect,Fail diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index d8f772c3129..335eaaee328 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -1396,11 +1396,14 @@ assign_producer_var_io(gl_shader_stage stage, nir_variable *var, unsigned *reser } if (slot_map[slot] == 0xff) { assert(*reserved < MAX_VARYING); - slot_map[slot] = *reserved; - if (stage == MESA_SHADER_TESS_EVAL && var->data.mode == nir_var_shader_in && !var->data.patch) - *reserved += glsl_count_vec4_slots(glsl_get_array_element(var->type), false, false); + unsigned num_slots; + if (nir_is_arrayed_io(var, stage)) + num_slots = glsl_count_vec4_slots(glsl_get_array_element(var->type), false, false); else - *reserved += glsl_count_vec4_slots(var->type, false, false); + num_slots = glsl_count_vec4_slots(var->type, false, false); + assert(*reserved + num_slots <= MAX_VARYING); + for (unsigned i = 0; i < num_slots; i++) + slot_map[slot + i] = (*reserved)++; } slot = slot_map[slot]; assert(slot < MAX_VARYING);