From 8bffd601ede40f259b3f9239e3d67393e47138e9 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 4 Aug 2022 12:41:35 +1000 Subject: [PATCH] Revert "nir: Preserve offsets in lower_io_to_scalar_early" This reverts commit 96fa23bca5ac88e0cd2dd0c45fdef71b2afe888d. The correct fix to the problem was a1bc1523408a3, making this change obsolete as the pass skips any vars marked with always_active_io. There was no real advantage to allowing these vars to be split because they can't be removed anyway. Also there is no way to split varying arrays gracefully here due to the xfb layout rules, and this change didn't handle arrays at all. Removing this obsolete code also fixes an assert in the new CTS test KHR-Single-GL45.enhanced_layouts.xfb_all_stages. The test was legally adding xfb offsets to all vertex stages but since we only mark the varyings in the final vertex stage with the always_active_io flag the other stages were correctly lowering to scalars but when an array with an offset hit this code it asserted since it couldn't handle it. Acked-by: Pierre-Eric Pelloux-Prayer Fixes: a1bc1523408a3 ("spirv: mark variables decorated with XfbBuffer as always active") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6928 Part-of: --- src/compiler/nir/nir_lower_io_to_scalar.c | 8 -------- src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt | 3 --- src/intel/ci/iris-amly-fails.txt | 3 --- src/intel/ci/iris-apl-fails.txt | 3 --- src/intel/ci/iris-cml-fails.txt | 3 --- src/intel/ci/iris-glk-fails.txt | 3 --- src/intel/ci/iris-kbl-fails.txt | 3 --- src/intel/ci/iris-whl-fails.txt | 3 --- 8 files changed, 29 deletions(-) diff --git a/src/compiler/nir/nir_lower_io_to_scalar.c b/src/compiler/nir/nir_lower_io_to_scalar.c index 25153d39bdb..12c6a7a46f3 100644 --- a/src/compiler/nir/nir_lower_io_to_scalar.c +++ b/src/compiler/nir/nir_lower_io_to_scalar.c @@ -341,10 +341,6 @@ lower_load_to_scalar_early(nir_builder *b, nir_intrinsic_instr *intr, chan_var = nir_variable_clone(var, b->shader); chan_var->data.location_frac = var->data.location_frac + i; chan_var->type = glsl_channel_type(chan_var->type); - if (var->data.explicit_offset) { - unsigned comp_size = glsl_get_bit_size(chan_var->type) / 8; - chan_var->data.offset = var->data.offset + i * comp_size; - } chan_vars[var->data.location_frac + i] = chan_var; @@ -399,10 +395,6 @@ lower_store_output_to_scalar_early(nir_builder *b, nir_intrinsic_instr *intr, chan_var = nir_variable_clone(var, b->shader); chan_var->data.location_frac = var->data.location_frac + i; chan_var->type = glsl_channel_type(chan_var->type); - if (var->data.explicit_offset) { - unsigned comp_size = glsl_get_bit_size(chan_var->type) / 8; - chan_var->data.offset = var->data.offset + i * comp_size; - } chan_vars[var->data.location_frac + i] = chan_var; diff --git a/src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt b/src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt index 201d0dd413a..db891e55930 100644 --- a/src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt +++ b/src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt @@ -23,9 +23,6 @@ dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_x,Fa dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_y,Fail dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_x,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL45.enhanced_layouts.xfb_all_stages,Crash - spec@glsl-1.20@compiler@invalid-vec4-array-to-vec3-array-conversion.vert,Fail spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail diff --git a/src/intel/ci/iris-amly-fails.txt b/src/intel/ci/iris-amly-fails.txt index 9e9ee7d01ab..b2c73fd17b3 100644 --- a/src/intel/ci/iris-amly-fails.txt +++ b/src/intel/ci/iris-amly-fails.txt @@ -14,6 +14,3 @@ dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x8,Fail dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.12,Crash - -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash diff --git a/src/intel/ci/iris-apl-fails.txt b/src/intel/ci/iris-apl-fails.txt index d9fc801d79d..03d12bcd5de 100644 --- a/src/intel/ci/iris-apl-fails.txt +++ b/src/intel/ci/iris-apl-fails.txt @@ -1,4 +1 @@ dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.12,Crash - -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash diff --git a/src/intel/ci/iris-cml-fails.txt b/src/intel/ci/iris-cml-fails.txt index 7f427d58e26..c1f718266c7 100644 --- a/src/intel/ci/iris-cml-fails.txt +++ b/src/intel/ci/iris-cml-fails.txt @@ -12,6 +12,3 @@ dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.6x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x5,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x8,Fail - -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash diff --git a/src/intel/ci/iris-glk-fails.txt b/src/intel/ci/iris-glk-fails.txt index 1296dec6103..f98f3fbcd4d 100644 --- a/src/intel/ci/iris-glk-fails.txt +++ b/src/intel/ci/iris-glk-fails.txt @@ -4,6 +4,3 @@ KHR-GL46.texture_buffer.texture_buffer_atomic_functions,Fail KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions,Fail dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.12,Crash - -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash diff --git a/src/intel/ci/iris-kbl-fails.txt b/src/intel/ci/iris-kbl-fails.txt index e436f70c55f..5a3e3a1652e 100644 --- a/src/intel/ci/iris-kbl-fails.txt +++ b/src/intel/ci/iris-kbl-fails.txt @@ -13,9 +13,6 @@ dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x5,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x8,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash - glx@glx-swap-pixmap-bad,Fail # failed to create drawable diff --git a/src/intel/ci/iris-whl-fails.txt b/src/intel/ci/iris-whl-fails.txt index 7f427d58e26..c1f718266c7 100644 --- a/src/intel/ci/iris-whl-fails.txt +++ b/src/intel/ci/iris-whl-fails.txt @@ -12,6 +12,3 @@ dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.6x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x5,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x6,Fail dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.8x8,Fail - -# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17878 -KHR-Single-GL46.enhanced_layouts.xfb_all_stages,Crash