radv: Ensure we never decompress or FCE read-only textures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
This commit is contained in:

committed by
Marge Bot

parent
66e17b410a
commit
b5ecf0748a
@@ -38,6 +38,13 @@
|
||||
|
||||
#include "gfx10_format_table.h"
|
||||
|
||||
|
||||
static const VkImageUsageFlagBits RADV_IMAGE_USAGE_WRITE_BITS =
|
||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
|
||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_STORAGE_BIT;
|
||||
|
||||
static unsigned
|
||||
radv_choose_tiling(struct radv_device *device,
|
||||
const VkImageCreateInfo *pCreateInfo,
|
||||
@@ -2018,6 +2025,9 @@ bool radv_layout_can_fast_clear(const struct radv_device *device,
|
||||
!radv_layout_dcc_compressed(device, image, layout, in_render_loop, queue_mask))
|
||||
return false;
|
||||
|
||||
if (!(image->usage & RADV_IMAGE_USAGE_WRITE_BITS))
|
||||
return false;
|
||||
|
||||
return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
|
||||
queue_mask == (1u << RADV_QUEUE_GENERAL);
|
||||
}
|
||||
@@ -2028,6 +2038,11 @@ bool radv_layout_dcc_compressed(const struct radv_device *device,
|
||||
bool in_render_loop,
|
||||
unsigned queue_mask)
|
||||
{
|
||||
/* If the image is read-only, we can always just keep it compressed */
|
||||
if (!(image->usage & RADV_IMAGE_USAGE_WRITE_BITS) &&
|
||||
radv_image_has_dcc(image))
|
||||
return false;
|
||||
|
||||
/* Don't compress compute transfer dst, as image stores are not supported. */
|
||||
if ((layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ||
|
||||
layout == VK_IMAGE_LAYOUT_GENERAL) &&
|
||||
|
Reference in New Issue
Block a user