anv: Allow selecting the slice of a 3D image
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 21 Jan 2017 03:47:18 +0000 (19:47 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 Jan 2017 20:27:48 +0000 (12:27 -0800)
As per VK_KHR_maintenance1, clients can render to a slice of a 3D image
by creating a VK_IMAGE_VIEW_TYPE_2D view of it.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_image.c

index 12cca67a985d5bfd370b69827d724908543e0e74..1c4282162f3a1a9c304efb2737b99c31a09163a4 100644 (file)
@@ -529,7 +529,7 @@ anv_CreateImageView(VkDevice _device,
       .depth  = anv_minify(image->extent.depth , range->baseMipLevel),
    };
 
-   if (image->type == VK_IMAGE_TYPE_3D) {
+   if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D) {
       iview->isl.base_array_layer = 0;
       iview->isl.array_len = iview->extent.depth;
    }