KhronosGroup / KhronosGroup/Vulkan-Docs

Suspicious VkMemoryRequirements inconsistency between image and buffer flags

Open
#940 0 comments 0 reactions 0 assignees View on GitHub
Resolving Inside Khronos
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

Under `VkMemoryRequirements` images are restricted like so:

> For images created with a color format, the `memoryTypeBits` member is identical for all `VkImage` objects created with the same combination of values for the tiling member, the `VK_IMAGE_CREATE_SPARSE_BINDING_BIT` bit of the flags member, the `VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT` bit of the flags member, `handleTypes` member of `VkExternalMemoryImageCreateInfo`, and the `VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT` of the usage member in the `VkImageCreateInfo` structure passed to `vkCreateImage`.

But Buffers are restricted like so:

> The `memoryTypeBits` member is identical for all `VkBuffer` objects created with the same value for the `flags` and `usage` members in the `VkBufferCreateInfo` structure and the `handleTypes` member of the `VkExternalMemoryBufferCreateInfo` structure passed to `vkCreateBuffer`.

Images and Buffers share similar creation flags for Sparse and Protected feature. So I find it suspicious Images only care about the `VK_IMAGE_CREATE_SPARSE_BINDING_BIT`, while Buffers may change even for the more specific `SPARSE_RESIDENCY_BIT` and `SPARSE_ALIASED_BIT`. Also Image is guaranteed to have same `memoryType` whether it is `PROTECTED` on not. But buffer does not have such guarantee.

Contributor guide

Open the contributing guide

Research direction

Compare the VkMemoryRequirements wording for images and buffers with the VkImageCreateInfo and VkBufferCreateInfo flags named in the issue. Determine whether the memoryTypeBits guarantees are intentionally different; done means the specification is confirmed consistent or the affected wording is identified for correction.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.