view.format = lvp_vk_format_to_pipe_format(iv->vk.format);
if (iv->vk.view_type == VK_IMAGE_VIEW_TYPE_3D) {
- view.u.tex.first_layer = iv->vk.storage.slice_offset;
- view.u.tex.last_layer = view.u.tex.first_layer + iv->vk.storage.slice_count - 1;
+ view.u.tex.first_layer = iv->vk.storage.z_slice_offset;
+ view.u.tex.last_layer = view.u.tex.first_layer + iv->vk.storage.z_slice_count - 1;
} else {
view.u.tex.first_layer = iv->vk.base_array_layer,
view.u.tex.last_layer = iv->vk.base_array_layer + iv->vk.layer_count - 1;
/* By default storage uses the same as the image properties, but it can be
* overriden with VkImageViewSlicedCreateInfoEXT.
*/
- image_view->storage.slice_offset = 0;
- image_view->storage.slice_count = image_view->extent.depth;
+ image_view->storage.z_slice_offset = 0;
+ image_view->storage.z_slice_count = image_view->extent.depth;
const VkImageViewSlicedCreateInfoEXT *sliced_info =
vk_find_struct_const(pCreateInfo, IMAGE_VIEW_SLICED_CREATE_INFO_EXT);
case VK_IMAGE_TYPE_3D:
if (sliced_info) {
unsigned total = image_view->extent.depth;
- image_view->storage.slice_offset = sliced_info->sliceOffset;
- assert(image_view->storage.slice_offset < total);
+ image_view->storage.z_slice_offset = sliced_info->sliceOffset;
+ assert(image_view->storage.z_slice_offset < total);
if (sliced_info->sliceCount == VK_REMAINING_3D_SLICES_EXT) {
- image_view->storage.slice_count = total - image_view->storage.slice_offset;
+ image_view->storage.z_slice_count = total - image_view->storage.z_slice_offset;
} else {
- image_view->storage.slice_count = sliced_info->sliceCount;
+ image_view->storage.z_slice_count = sliced_info->sliceCount;
}
- assert(image_view->storage.slice_offset + image_view->storage.slice_count
+ assert(image_view->storage.z_slice_offset + image_view->storage.z_slice_count
<= image->extent.depth);
}
assert(image_view->base_array_layer + image_view->layer_count
uint32_t base_array_layer;
uint32_t layer_count;
+ /* VK_EXT_sliced_view_of_3d */
struct {
- uint32_t slice_offset;
- uint32_t slice_count;
+ /* VkImageViewSlicedCreateInfoEXT::sliceOffset
+ *
+ * This field will be 0 for 1D and 2D images or when no
+ * VkImageViewSlicedCreateInfoEXT is provided.
+ */
+ uint32_t z_slice_offset;
+
+ /* VkImageViewSlicedCreateInfoEXT::sliceCount
+ *
+ * This field will be 1 for 1D and 2D images and the image view depth
+ * (see vk_image_view::extent) when no VkImageViewSlicedCreateInfoEXT is
+ * provided.
+ */
+ uint32_t z_slice_count;
} storage;
/* VK_EXT_image_view_min_lod */