summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2018-01-11 13:21:50 +0100
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2018-01-18 01:57:52 +0100
commit2ce11ac11fee594ca01608c4006b38c0c8ea37ff (patch)
treeabe834e49005a77c17a5ee7c5d0c07b350f9c658
parente2b9296146746635cd631c5212ae56f0cd270820 (diff)
radv: Initialize DCC on transition from preinitialized.
Looks like the decompress does not handle invalid encodings well, which happens with random memory. Of course apps should not use it with random memory, but they are allowed to .... Fixes: 44fcf58744 "radv: Disable DCC for GENERAL layout and compute transfer dest." Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 67799a13cc2..172f95e7c99 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -4026,7 +4026,9 @@ static void radv_handle_dcc_image_transition(struct radv_cmd_buffer *cmd_buffer,
unsigned dst_queue_mask,
const VkImageSubresourceRange *range)
{
- if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
+ if (src_layout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
+ radv_initialize_dcc(cmd_buffer, image, 0xffffffffu);
+ } else if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
radv_initialize_dcc(cmd_buffer, image,
radv_layout_dcc_compressed(image, dst_layout, dst_queue_mask) ?
0x20202020u : 0xffffffffu);