Skip to content

Comments

Vulkan: Correctly handle 3D images with 2D views#2478

Merged
bjoeris merged 1 commit intogoogle:masterfrom
bjoeris:3d-image-2d-view-2
Dec 19, 2018
Merged

Vulkan: Correctly handle 3D images with 2D views#2478
bjoeris merged 1 commit intogoogle:masterfrom
bjoeris:3d-image-2d-view-2

Conversation

@bjoeris
Copy link
Contributor

@bjoeris bjoeris commented Dec 17, 2018

The spec allows 2D VkImageViews of 3D VkImages. The array layers of the 2D
view correspond to depth in the 3D image. For example, the valid usage for
VkImageViewCreateInfo specifies:

If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is a
3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and
viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY,
subresourceRange::layerCount must be non-zero and
subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less
than or equal to the extent.depth specified in VkImageCreateInfo when image
was created

@bjoeris bjoeris requested a review from qining December 17, 2018 19:48
@qining
Copy link
Contributor

qining commented Dec 17, 2018

Maybe change the name accessImageSubresourceDepth to accessImageSubresourceSlices, which looks more consistent to the spec. Otherwise looks good to me.

@qining qining requested a review from AWoloszyn December 17, 2018 21:15
@bjoeris bjoeris force-pushed the 3d-image-2d-view-2 branch 2 times, most recently from b4c2ced to 6ae346d Compare December 18, 2018 19:12
The spec allows 2D `VkImageView`s of 3D `VkImage`s. The array layers of the 2D
view correspond to depth in the 3D image. For example, the valid usage for
VkImageViewCreateInfo specifies:

> If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is a
> 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and
> viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY,
> subresourceRange::layerCount must be non-zero and
> subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less
> than or equal to the extent.depth specified in VkImageCreateInfo when image
> was created
@bjoeris bjoeris merged commit 4e1d040 into google:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants