anv/image: Set correct base_array_layer and array_len for storage images
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 13 Sep 2016 21:02:32 +0000 (14:02 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 13 Sep 2016 21:45:49 +0000 (14:45 -0700)
Since Vulkan doesn't allow single-slice 3D storage images, we need to just
set the base_array_layer and array_len to the full size of the 3-D LOD.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_image.c

index 3ab11e749cac2a88681f94264377b4af25f8d02c..f6e86725f9f93f26273e10518ff79531b99d41ce 100644 (file)
@@ -492,6 +492,10 @@ anv_image_view_init(struct anv_image_view *iview,
          isl_view.usage = cube_usage | ISL_SURF_USAGE_STORAGE_BIT;
          isl_view.format = isl_lower_storage_image_format(&device->info,
                                                           isl_view.format);
+         if (image->type == VK_IMAGE_TYPE_3D) {
+            isl_view.base_array_layer = 0;
+            isl_view.array_len = iview->extent.depth;
+         }
          isl_surf_fill_state(&device->isl_dev,
                              iview->storage_surface_state.map,
                              .surf = &surface->isl,