From 57941b61ab12a2c9f6cd97fd08fea5d1ae04414e Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Wed, 2 Dec 2015 18:41:08 -0800 Subject: anv/image: Vulkan's depthPitch is in bytes, not rows Fix for VkGetImageSubresourceLayout. --- src/vulkan/anv_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c index c831d756407..157357ea74d 100644 --- a/src/vulkan/anv_image.c +++ b/src/vulkan/anv_image.c @@ -417,7 +417,9 @@ anv_surface_get_subresource_layout(struct anv_image *image, layout->offset = surface->offset; layout->rowPitch = surface->stride; - layout->depthPitch = surface->qpitch; + + /* Anvil's qpitch is in units of rows. Vulkan's depthPitch is in bytes. */ + layout->depthPitch = surface->qpitch * surface->stride; /* FINISHME: We really shouldn't be doing this calculation here */ if (image->array_size > 1) -- cgit v1.2.3