anv/image: Vulkan's depthPitch is in bytes, not rows
authorChad Versace <chad.versace@intel.com>
Thu, 3 Dec 2015 02:41:08 +0000 (18:41 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 3 Dec 2015 23:26:11 +0000 (15:26 -0800)
Fix for VkGetImageSubresourceLayout.

src/vulkan/anv_image.c

index c831d7564074cb497671a7dac8106234c9ec1419..157357ea74d0d86089e1c4269c06e008179f5b63 100644 (file)
@@ -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)