radv: Pass CMASK alignment to application.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 6 Feb 2017 23:24:16 +0000 (00:24 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 7 Feb 2017 00:18:53 +0000 (01:18 +0100)
CMASK alignment can be greater than image data alignment, so pass
it to the app so that it knows what alignment to backing memory
should have.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index 99d17376cf65e6e5d5b8742147b10cc52fc4c4cf..202f460aafe574011b3a8341fdf1d0b5ee4d1a91 100644 (file)
@@ -571,6 +571,7 @@ radv_image_alloc_cmask(struct radv_device *device,
        /* + 8 for storing the clear values */
        image->clear_value_offset = image->cmask.offset + image->cmask.size;
        image->size = image->cmask.offset + image->cmask.size + 8;
+       image->alignment = MAX2(image->alignment, image->cmask.alignment);
 }
 
 static void