From cf0786c766204625eeea42e840c1df1218ac1e28 Mon Sep 17 00:00:00 2001 From: Nick Hamilton Date: Mon, 2 Feb 2026 13:15:11 +0000 Subject: [PATCH] pco: Fix multiview sampling of subpass input attachments When sampling a subpass input attachment when multiview is been used the the view index is required. This becomes an extra output from the vertex shader which is then iterated into the fragment shader input where it is then used as the array layer index when sampling the subpass input attachment. However this extra output was not having its interpolation mode configured correctly leading to incorrect instructions being added causing the view index to always be zero and thus sampling the subpass input attachment incorrectly. Fix is to make sure the view index interpolation mode is set to flat. Fix: dEQP-VK.multiview.input_attachments.no_queries.1_2_4_8_16_32 dEQP-VK.multiview.input_attachments.no_queries.1_2_4_8 dEQP-VK.multiview.input_attachments.no_queries.15_15_15_15 dEQP-VK.multiview.input_attachments.no_queries.15 dEQP-VK.multiview.input_attachments.no_queries.5_10_5_10 dEQP-VK.multiview.input_attachments.no_queries.8_1_1_8 dEQP-VK.multiview.input_attachments.no_queries.8 dEQP-VK.multiview.input_attachments.no_queries.max_multi_view_view_count dEQP-VK.multiview.renderpass2.input_attachments.no_queries.1_2_4_8_16_32 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.1_2_4_8 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.15_15_15_15 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.15 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.5_10_5_10 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.8_1_1_8 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.8 dEQP-VK.multiview.renderpass2.input_attachments.no_queries.max_multi_view_view_count Signed-off-by: Nick Hamilton Reviewed-by: Simon Perretta Part-of: --- src/imagination/ci/bxs-4-64-fails.txt | 16 ---------------- src/imagination/pco/pco_nir_tex.c | 11 +++++++---- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/imagination/ci/bxs-4-64-fails.txt b/src/imagination/ci/bxs-4-64-fails.txt index 45c12382c39..62140569df9 100644 --- a/src/imagination/ci/bxs-4-64-fails.txt +++ b/src/imagination/ci/bxs-4-64-fails.txt @@ -27,22 +27,6 @@ dEQP-VK.memory.mapping.dedicated_alloc.image.full.variable.implicit_unmap,Timeou dEQP-VK.memory.mapping.dedicated_alloc.image.full.variable.implicit_unmap_map2,Timeout dEQP-VK.memory.mapping.suballocation.full.variable.implicit_unmap,Timeout dEQP-VK.memory.mapping.suballocation.full.variable.implicit_unmap_map2,Timeout -dEQP-VK.multiview.input_attachments.no_queries.15,Fail -dEQP-VK.multiview.input_attachments.no_queries.15_15_15_15,Fail -dEQP-VK.multiview.input_attachments.no_queries.1_2_4_8,Fail -dEQP-VK.multiview.input_attachments.no_queries.1_2_4_8_16_32,Fail -dEQP-VK.multiview.input_attachments.no_queries.5_10_5_10,Fail -dEQP-VK.multiview.input_attachments.no_queries.8,Fail -dEQP-VK.multiview.input_attachments.no_queries.8_1_1_8,Fail -dEQP-VK.multiview.input_attachments.no_queries.max_multi_view_view_count,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.15,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.15_15_15_15,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.1_2_4_8,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.1_2_4_8_16_32,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.5_10_5_10,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.8,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.8_1_1_8,Fail -dEQP-VK.multiview.renderpass2.input_attachments.no_queries.max_multi_view_view_count,Fail dEQP-VK.pipeline.monolithic.empty_fs.masked_samples,Fail dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d24_unorm_s8_uint,Fail dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d32_sfloat_s8_uint,Fail diff --git a/src/imagination/pco/pco_nir_tex.c b/src/imagination/pco/pco_nir_tex.c index 9d1b4beef44..a15e21d00e9 100644 --- a/src/imagination/pco/pco_nir_tex.c +++ b/src/imagination/pco/pco_nir_tex.c @@ -1353,10 +1353,13 @@ static nir_def *lower_image(nir_builder *b, nir_instr *instr, void *cb_data) .num_slots = 1, }); - nir_get_variable_with_location(b->shader, - nir_var_shader_in, - data->fs.view_index_slot, - glsl_uint_type()); + nir_variable *view_index_var = + nir_get_variable_with_location(b->shader, + nir_var_shader_in, + data->fs.view_index_slot, + glsl_uint_type()); + + view_index_var->data.interpolation = INTERP_MODE_FLAT; } coords = nir_pad_vector(b, coords, 3);