[Mesa-dev] [PATCH] anv: image: report correct depthPicth for 3d images
Lionel Landwerlin
llandwerlin at gmail.com
Sat Dec 3 15:50:44 UTC 2016
With a 3d image of 2x2x3, vkGetImageSubresourceLayout currently reports :
VkSubresourceLayout = { offset = 0,
size = 160,
rowPitch = 16,
arrayPitch = 96,
depthPitch = 96 }
depthPitch should be 32.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/vulkan/anv_image.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index e60373a..9ef0760 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -376,7 +376,8 @@ anv_surface_get_subresource_layout(struct anv_image *image,
layout->offset = surface->offset;
layout->rowPitch = surface->isl.row_pitch;
- layout->depthPitch = isl_surf_get_array_pitch(&surface->isl);
+ layout->depthPitch =
+ isl_surf_get_array_pitch(&surface->isl) / image->extent.depth;
layout->arrayPitch = isl_surf_get_array_pitch(&surface->isl);
layout->size = surface->isl.size;
}
--
2.10.2
More information about the mesa-dev
mailing list