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

2D texture cannot be used where a 2D array texture is expected. #2061

Closed
danielmaciel opened this issue Jul 25, 2020 · 2 comments
Closed

2D texture cannot be used where a 2D array texture is expected. #2061

danielmaciel opened this issue Jul 25, 2020 · 2 comments
Assignees
Milestone

Comments

@danielmaciel
Copy link

danielmaciel commented Jul 25, 2020

I am getting this validation error now after an SDK update:

Validation Error: [ UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotUpdated ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0x50363c8d | VkDescriptorSet 0x0[] encountered the following validation error at vkCmdDrawIndexed() time: Descriptor in binding #1 index 0 requires an image view of type VK_IMAGE_VIEW_TYPE_2D_ARRAY but got VK_IMAGE_VIEW_TYPE_2D.

A non-array texture is just an array of 1 element. Plus it works and traditionally has worked for years since the OpenGL days. It is a convenience thing to not have to write, load, compile and maintain two different shaders for no reason.

EDIT: If you really want to keep this behavior, would you please then, if possible, add a link to the spec section that justifies this?

I am currently trying to make sense out of this
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-views-compatibility
but I think it is expected that 2D and 2D_ARRAY textures be compatible with each other in this scenario

@mark-lunarg
Copy link
Contributor

This does make a lot of sense, but there does seem to be a distinction in this case which is at least implied by the following text in the 15.3.1. Texel Input Validation Operations section (which is the basis for the descriptor binding requirements/image view type check). SPIRV seems to require that 'Arrayed' be set based on the image view type. There doesn't appear to be enough evidence one way or the other to make a change at this time.

It might be helpful to create an issue a Vulkan-Docs to see if clarification is needed in the specification, or if the validation layer interpretation is incomplete or incorrect.

The SPIR-V instruction’s image variable’s properties are not compatible with the image view:
Rules for viewType:
VK_IMAGE_VIEW_TYPE_1D must have Dim = 1D, Arrayed = 0, MS = 0.
VK_IMAGE_VIEW_TYPE_2D must have Dim = 2D, Arrayed = 0.
VK_IMAGE_VIEW_TYPE_3D must have Dim = 3D, Arrayed = 0, MS = 0.
VK_IMAGE_VIEW_TYPE_CUBE must have Dim = Cube, Arrayed = 0, MS = 0.
VK_IMAGE_VIEW_TYPE_1D_ARRAY must have Dim = 1D, Arrayed = 1, MS = 0.
VK_IMAGE_VIEW_TYPE_2D_ARRAY must have Dim = 2D, Arrayed = 1.
VK_IMAGE_VIEW_TYPE_CUBE_ARRAY must have Dim = Cube, Arrayed = 1, MS = 0.

@mark-lunarg mark-lunarg self-assigned this Aug 5, 2020
@mark-lunarg
Copy link
Contributor

@danielmaciel, I was unable to find anything relevant in the public or private Vulkan repositories related to this specific issue. In the absence of anything more concrete to override the current assumptions, I am going to close this issue but if you develop further justification or get the Vulkan spec folks to weigh in, please comment here to get this reopened, or create a new issue. Thanks!

@shannon-lunarg shannon-lunarg added this to the sdk-1.2.154 milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants