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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22440>
This commit is contained in:
Samuel Pitoiset 2023-04-12 14:03:56 +02:00 committed by Marge Bot
parent 8f024cdd4d
commit 0b4e7491f3
2 changed files with 10 additions and 9 deletions

View file

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

View file

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