So, I\'m gathering some info about my device in Vulkan during initialization and find a unique (or rather, quite similar) set of memory types returned by vkGetPhysicalDevice
As far as the Vulkan specification is concerned:
VkMemoryRequirements::memoryTypeBits
tells you which types you can useSo, the best/expected practice is:
1) Decide which flags you want/need.
2) Further filter the list with those types allowed by VkMemoryRequirements::memoryTypeBits
3) If there are any types left pick the first one. (Or start from step 1 with even less flags.)
The Vulkan does not necessarily know (and report) everything. But as long as you stick to the above you should be fine.
The What’s your Vulkan Memory Type? NVIDIA article seems to describe what is happening for the host-local types:
In OpenGL or DirectX 11, the driver traditionally has been supporting the application’s resource allocation by moving resources between device local and system memory in case of oversubscription of device memory, which can happen if the user might select image quality settings that exceed the amount of available device local memory.
[...]
To enable this, we are exposing additional host-local memory types:
- A memory type for buffers
- A memory type for color images of any format
- Separate memory types for depth/stencil images for each depth/stencil format in system memory
The math seems to check out: 1(for buffers) + 1(for images) + 5(which seems to match supported depth formats on this GPU) = 7.
I would expect similar rationale for the device local types. SPECULATION: Possibly one for depth resources and one for images and buffers.