Commit b5ecf074 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen Committed by Marge Bot
Browse files

radv: Ensure we never decompress or FCE read-only textures.


Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <mesa/mesa!8817>
parent 66e17b41
......@@ -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) &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment