KhronosGroup / KhronosGroup/Vulkan-Docs
Property for max unique/hardware sampler count
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
Currently Vulkan has the property `maxSamplerAllocationCount`, which specifies how many `VkSampler` objects can be created at maximum. This can be useful for cases like emulators which may want to keep a cache of Vulkan samplers mapping to the emulated GPU samplers, and want to know when they are approaching the maximum number of samplers to perform garbage collection on least-recently-used cache entries.
The problem here arises from drivers for some generations of Apple hardware like KosmicKrisp (Vulkan on Metal) and HoneyKrisp (direct Linux GPU driver) which have an additional limitation that only 1024 *unique* samplers can exist. So for example, you are technically allowed to create up to `maxSamplerAllocationCount` `VkSampler` objects as described, but if more than 1024 of those are configured uniquely, `vkCreateSampler` will return `VK_ERROR_OUT_OF_HOST_MEMORY`.
Meanwhile, the existing limit `maxSamplerAllocationCount` cannot be lowered to cover this since it would fall below the Vulkan 1.0 required limit minimum of 4000.
The ask here is that there be a new limit property defined which describes the maximum number of unique samplers that may exist at once, so that the application can utilize this information when managing its sampler allocations to avoid hitting out-of-memory errors and thrashing the cache.
Contributor guide
Research direction
Start by reviewing the Vulkan specification's existing maxSamplerAllocationCount property and the issue's examples of unique sampler limits. Determine the scope and definition of a new unique-sampler limit property; done means the proposed property and its behavior are agreed for inclusion in the specification.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100