From e46b41b3aec3e3e1671b9a088291909f74953a88 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sun, 7 Jul 2019 21:24:17 +0200 Subject: [PATCH] radv: Handle cmask being disallowed by addrlib. alignment=0 does weird things with align64. CC: Reviewed-by: Dave Airlie --- src/amd/vulkan/radv_image.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 1ba1a38c86f..6245873a4ed 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1153,6 +1153,11 @@ radv_image_alloc_cmask(struct radv_device *device, uint32_t clear_value_size = 0; radv_image_get_cmask_info(device, image, &image->cmask); + if (!image->cmask.size) + return; + + assert(image->cmask.alignment); + image->cmask.offset = align64(image->size, image->cmask.alignment); /* + 8 for storing the clear values */ if (!image->clear_value_offset) { -- 2.30.2