From e1c89abd8616dc6ae6d492ac43c70ca2d6a002ef Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Thu, 28 Jul 2022 10:28:55 +0300 Subject: [PATCH] ir3: Never remove GS_HEADER_IR3 sysval input Without GS header geometry shader is never invoked which may cause issues if it has side-effects. Fixes GL CTS tests running via Zink: KHR-GL46.shader_image_load_store.multiple-uniforms KHR-GL46.texture_cube_map_array.image_op_geometry_sh Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6940 Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/ir3/ir3_dce.c | 19 +++++++++++++------ .../drivers/zink/ci/zink-tu-a630-fails.txt | 6 ------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/freedreno/ir3/ir3_dce.c b/src/freedreno/ir3/ir3_dce.c index a3ddbe802b1..02cd29b68dd 100644 --- a/src/freedreno/ir3/ir3_dce.c +++ b/src/freedreno/ir3/ir3_dce.c @@ -111,12 +111,19 @@ find_and_remove_unused(struct ir3 *ir, struct ir3_shader_variant *so) */ foreach_block (block, &ir->block_list) { foreach_instr (instr, &block->instr_list) { - /* special case, if pre-fs texture fetch used, we cannot - * eliminate the barycentric i/j input - */ - if (so->num_sampler_prefetch && (instr->opc == OPC_META_INPUT) && - (instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL)) - continue; + if (instr->opc == OPC_META_INPUT) { + /* special case, if pre-fs texture fetch used, we cannot + * eliminate the barycentric i/j input + */ + if (so->num_sampler_prefetch && + instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL) + continue; + + /* Without GS header geometry shader is never invoked. */ + if (instr->input.sysval == SYSTEM_VALUE_GS_HEADER_IR3) + continue; + } + instr->flags |= IR3_INSTR_UNUSED; } } diff --git a/src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt b/src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt index b2e8ecc9bb0..70654ce212d 100644 --- a/src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt @@ -8,12 +8,6 @@ KHR-Single-GL46.arrays_of_arrays_gl.SubroutineFunctionCalls2,Crash dEQP-GLES31.functional.texture.border_clamp.range_clamp.linear_srgb_color,Fail dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_srgb_color,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/6940 -KHR-GL46.shader_image_load_store.multiple-uniforms,Fail -KHR-GL46.texture_cube_map_array.image_op_geometry_sh,Fail -KHR-GLES31.core.texture_cube_map_array.image_op_geometry_sh,Fail -KHR-GLES32.core.texture_cube_map_array.image_op_geometry_sh,Fail - # Turnip has maxFragmentInputComponents = 124, while GL requires # gl_MaxFragmentInputComponents >= 128 KHR-GL46.limits.max_fragment_input_components,Fail