From 0b4e7491f3f7528f251458f4e84657b16af6df12 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 12 Apr 2023 14:03:56 +0200 Subject: [PATCH] radv: fix detecting FMASK_DECOMPRESS/DCC_DECOMPRESS meta pipelines With the on_demand shaders feature, meta pipelines are only created when they are used, otherwise they are NULL. Though, inside secondary cmdbuffers, the graphics pipeline might be also NULL. In this specific case, radv_is_{dcc,fmask}_decompress_pipeline() would return TRUE because these pipelines are NULL too... This fixes flakes with tests that use secondary cmdbuffers with TC-compat images. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/ci/radv-navi21-aco-flakes.txt | 3 --- src/amd/vulkan/meta/radv_meta.h | 16 ++++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/amd/ci/radv-navi21-aco-flakes.txt b/src/amd/ci/radv-navi21-aco-flakes.txt index 03e7277e53c..2739f683563 100644 --- a/src/amd/ci/radv-navi21-aco-flakes.txt +++ b/src/amd/ci/radv-navi21-aco-flakes.txt @@ -15,6 +15,3 @@ dEQP-VK.draw.renderpass.linear_interpolation.no_offset_8_samples dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolate_at_ignores_centroid.128_128_1.samples_8 dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.before_draw.line_stipple_enable - -dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.linear_interpolation.no_offset_4_samples -dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.linear_interpolation.offset_max_4_samples diff --git a/src/amd/vulkan/meta/radv_meta.h b/src/amd/vulkan/meta/radv_meta.h index 88fcd320d98..6f273be5795 100644 --- a/src/amd/vulkan/meta/radv_meta.h +++ b/src/amd/vulkan/meta/radv_meta.h @@ -239,11 +239,12 @@ void radv_meta_decode_etc(struct radv_cmd_buffer *cmd_buffer, struct radv_image static inline bool radv_is_fmask_decompress_pipeline(struct radv_cmd_buffer *cmd_buffer) { - struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state; struct radv_graphics_pipeline *pipeline = cmd_buffer->state.graphics_pipeline; - return radv_pipeline_to_handle(&pipeline->base) == - meta_state->fast_clear_flush.fmask_decompress_pipeline; + if (!pipeline) + return false; + + return pipeline->custom_blend_mode == V_028808_CB_FMASK_DECOMPRESS; } /** @@ -252,11 +253,14 @@ radv_is_fmask_decompress_pipeline(struct radv_cmd_buffer *cmd_buffer) static inline bool radv_is_dcc_decompress_pipeline(struct radv_cmd_buffer *cmd_buffer) { - struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state; struct radv_graphics_pipeline *pipeline = cmd_buffer->state.graphics_pipeline; - return radv_pipeline_to_handle(&pipeline->base) == - meta_state->fast_clear_flush.dcc_decompress_pipeline; + if (!pipeline) + return false; + + return pipeline->custom_blend_mode == V_028808_CB_DCC_DECOMPRESS_GFX8 || + (cmd_buffer->device->physical_device->rad_info.gfx_level >= GFX11 && + pipeline->custom_blend_mode == V_028808_CB_DCC_DECOMPRESS_GFX11); } /* common nir builder helpers */