mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
radv: fix msaa feedback loop without tc-compat cmask
When in an msaa feedback loop and when the image does not have tc-compat
cmask, we have to decompress and expand fmask. This can happen on gfx9
when sample count > 2 or when RADV_DEBUG=notccompatcmask is specified.
Fixes: a38de4c011 ("radv: disable tc_compatible_cmask on GFX9 in some cases")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23331>
This commit is contained in:
parent
7e8e7f0823
commit
6cb5185916
1 changed files with 16 additions and 8 deletions
|
|
@ -2500,15 +2500,23 @@ radv_layout_fmask_compression(const struct radv_device *device, const struct rad
|
|||
if (layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL && (queue_mask & (1u << RADV_QUEUE_COMPUTE)))
|
||||
return RADV_FMASK_COMPRESSION_NONE;
|
||||
|
||||
if (layout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ||
|
||||
layout == VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL) {
|
||||
return radv_image_is_tc_compat_cmask(image) ? RADV_FMASK_COMPRESSION_FULL :
|
||||
RADV_FMASK_COMPRESSION_PARTIAL;
|
||||
}
|
||||
/* Compress images if TC-compat CMASK is enabled. */
|
||||
if (radv_image_is_tc_compat_cmask(image))
|
||||
return RADV_FMASK_COMPRESSION_FULL;
|
||||
|
||||
/* Only compress concurrent images if TC-compat CMASK is enabled (no FMASK decompression). */
|
||||
return (queue_mask == (1u << RADV_QUEUE_GENERAL) || radv_image_is_tc_compat_cmask(image)) ?
|
||||
RADV_FMASK_COMPRESSION_FULL : RADV_FMASK_COMPRESSION_NONE;
|
||||
switch (layout) {
|
||||
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
|
||||
case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
|
||||
/* Don't compress images but no need to expand FMASK. */
|
||||
return RADV_FMASK_COMPRESSION_PARTIAL;
|
||||
case VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT:
|
||||
/* Don't compress images that are in feedback loops. */
|
||||
return RADV_FMASK_COMPRESSION_NONE;
|
||||
default:
|
||||
/* Don't compress images that are concurrent. */
|
||||
return queue_mask == (1u << RADV_QUEUE_GENERAL) ?
|
||||
RADV_FMASK_COMPRESSION_FULL : RADV_FMASK_COMPRESSION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue