From 3d2d4728aaf3b3a417ce9507481d64297766bd54 Mon Sep 17 00:00:00 2001 From: Oleksii Bozhenko Date: Wed, 1 Mar 2023 15:04:00 +0200 Subject: [PATCH] Move combining clip and cull optimization before linking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As far gl_nir_link_glsl fills xfb data we should do it after lowering clip and cull in order to get correct locations. Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152 Signed-off-by: Oleksii Bozhenko Reviewed-by: Marek Olšák Part-of: --- src/freedreno/ci/freedreno-a618-fails.txt | 3 --- src/freedreno/ci/freedreno-a630-fails.txt | 3 --- src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt | 3 --- src/intel/ci/iris-kbl-fails.txt | 3 --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 10 +++++++--- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/freedreno/ci/freedreno-a618-fails.txt b/src/freedreno/ci/freedreno-a618-fails.txt index 0a01693..29ea0f2 100644 --- a/src/freedreno/ci/freedreno-a618-fails.txt +++ b/src/freedreno/ci/freedreno-a618-fails.txt @@ -334,9 +334,6 @@ spec@arb_query_buffer_object@qbo@query-GL_TIME_ELAPSED-SYNC_CPU_READ_AFTER_CACHE spill-dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_bool,Fail spill-dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_bool_requiredsubgroupsize128,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152 -spec@ext_transform_feedback@builtin-varyings gl_culldistance,Fail - # Failing (Color test failed) since wayland platform was enabled in arm builds wayland-dEQP-EGL.functional.wide_color.window_888_colorspace_default,Fail wayland-dEQP-EGL.functional.wide_color.window_fp16_default_colorspace,Fail diff --git a/src/freedreno/ci/freedreno-a630-fails.txt b/src/freedreno/ci/freedreno-a630-fails.txt index f84045d..cb6b0cc 100644 --- a/src/freedreno/ci/freedreno-a630-fails.txt +++ b/src/freedreno/ci/freedreno-a630-fails.txt @@ -337,9 +337,6 @@ spec@arb_query_buffer_object@qbo@query-GL_TIME_ELAPSED-SYNC_CPU_READ_AFTER_CACHE spec@arb_query_buffer_object@qbo@query-GL_TIME_ELAPSED-SYNC_CPU_READ_AFTER_CACHE_TEST-GL_UNSIGNED_INT,Fail spec@arb_query_buffer_object@qbo@query-GL_TIME_ELAPSED-SYNC_CPU_READ_AFTER_CACHE_TEST-GL_UNSIGNED_INT64_ARB,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152 -spec@ext_transform_feedback@builtin-varyings gl_culldistance,Fail - # Excerpt: # Image comparison failed: reference = -0.000488281, expected = 0:0:0:0, result = 0:0:0:3 # Image comparison failed: reference = 0, expected = 0:0:0:0, result = 0:0:0:3 diff --git a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt index 545abdc..50935d9 100644 --- a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt +++ b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt @@ -951,9 +951,6 @@ spec@nv_copy_image@nv_copy_image-formats --samples=8@Source: GL_RGBA8UI/Destinat spec@nv_copy_image@nv_copy_image-formats --samples=8@Source: GL_RGBA8_SNORM/Destination: GL_RG16I,Fail spec@nv_copy_image@nv_copy_image-formats --samples=8@Source: GL_RGBA8_SNORM/Destination: GL_RGBA8I,Fail -# See issue #7152 -spec@ext_transform_feedback@builtin-varyings gl_culldistance,Fail - # https://gitlab.freedesktop.org/mesa/mesa/-/issues/8348 KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_tessLevel,Fail KHR-GL46.tessellation_shader.tessellation_shader_tessellation.TES,Fail diff --git a/src/intel/ci/iris-kbl-fails.txt b/src/intel/ci/iris-kbl-fails.txt index 04fdf73..741930c 100644 --- a/src/intel/ci/iris-kbl-fails.txt +++ b/src/intel/ci/iris-kbl-fails.txt @@ -142,9 +142,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp,Fail spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode full precision,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152 -spec@ext_transform_feedback@builtin-varyings gl_culldistance,Fail - spec@!opengl 1.1@line-smooth-coverage,Fail spec@!opengl 1.1@line-smooth-stipple,Fail diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 3a7b5e0..8fa0ae7 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -775,6 +775,13 @@ st_link_nir(struct gl_context *ctx, nir_opt_access_options opt_access_options; opt_access_options.is_vulkan = false; NIR_PASS_V(nir, nir_opt_access, &opt_access_options); + + /* Combine clip and cull outputs into one array and set: + * - shader_info::clip_distance_array_size + * - shader_info::cull_distance_array_size + */ + if (!st->screen->get_param(st->screen, PIPE_CAP_CULL_DISTANCE_NOCOMBINE)) + NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays); } if (shader_program->data->spirv) { @@ -842,9 +849,6 @@ st_link_nir(struct gl_context *ctx, NIR_PASS_V(nir, nir_lower_system_values); NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); - if (!st->screen->get_param(st->screen, PIPE_CAP_CULL_DISTANCE_NOCOMBINE)) - NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays); - if (i >= 1) { struct gl_program *prev_shader = linked_shader[i - 1]->Program; -- 2.7.4