Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 19, 2018

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