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 <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17771>
This commit is contained in:
Danylo Piliaiev 2022-07-28 10:28:55 +03:00 committed by Marge Bot
parent ed7814def7
commit e1c89abd86
2 changed files with 13 additions and 12 deletions

View file

@ -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;
}
}

View file

@ -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