KhronosGroup / KhronosGroup/Vulkan-Docs
Sparse binding with aspects covering more than one `VkSparseImageMemoryRequirements`
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
The way `vkGetImageSparseMemoryRequirements` is set up, is set up, you receive multiple `VkSparseImageMemoryRequirements` structure values, and the `format_properties.aspectMask` field of each structure tells you which image aspects that structure applies to. When binding memory using `vkQueueBindSparse` though, there is nothing that disallows `VkSparseImageMemoryBind::subresource::aspectMask` from containing more than one aspect. This means that the aspect mask to be bound may intersect with more than one `VkSparseImageMemoryRequirements` structure.
What are the sparse requirements in such a case? Is each aspect bit of the bind operation to be checked separately against the `VkSparseImageMemoryRequirements` containing that bit? Is this an oversight and is sparse binding actually not meant to use aspects like this?
EDIT: looking more at how sparse binding is meant to work internally, having multiple aspects in a single `VkSparseImageMemoryRequirements` struct seems to indicate that the two aspects are stored together in a way that cannot easily be separated (e.g. interleaved depth + stencil). Therefore, it seems likely that the aspects you specify when sparse binding must exactly match the aspects of one of the `VkSparseImageMemoryRequirements` structs, otherwise it makes no sense to bind a block of contiguous memory like that.
Contributor guide
Assessment
This issue has not been assessed yet.