This PR fixes the profiles sample on Apple platforms by doing the following:
Enabling the VK_KHR_portability_enumeration extension and flag during instance creation.
Enabling MoltenVK's Metal Argument Buffer feature on macOS. This uses the layer settings capability (note this does not depend on my pending layer settings framework PR), and falls back to an environment variable if layer settings is not available at runtime for older SDKs.
Using the VP_LUNARG_desktop_portability_2021_subset profile on portability platforms. In addition to the standard desktop capabilities, this also checks the platform's portability subset features. UPDATE: Added an additional #ifdef guard to prevent build failures on iOS for current build configs (i.e. prior to merging my pending framework PR). This defensive check may become redundant in the future, but at least will be compatible and will not cause problems.
UPDATE: Even though iOS will support Metal Argument Buffers staring with MoltenVK 1.2.10 and later (expected in the next Vulkan SDK following 1.3.290), that device platform does not support all features required for the selected Vulkan profile. For instance on iPhone 15, the following device features are missing: fragmentStoresAndAtomics, shaderStorageImageArrayDynamicIndexing, textureCompressionBC, and vertexPipelineStoresAndAtomics. In addition, some limits are lower than required: maxPerStageDescriptorSampledImages = 96, maxPerStageResources = 127, and maxPerStageDescriptorUpdateAfterBindInputAttachments = 96, and finally some image formats and/or tiling capabilities are not supported (e.g. all VK_FORMAT_<*>_BLOCK formats and some tiling features of VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32_SFLOAT).
Note that all code changes are guarded by VKB_ENABLE_PORTABILITY, so it will only affect portability platforms.
[X] I have commented any added functions (in line with Doxygen)
[X] I have commented any code that could be hard to understand
[X] My changes do not add any new compiler warnings
[X] My changes do not add any new validation layer errors or warnings
[X] I have used existing framework/helper functions where possible
[X] My changes do not add any regressions
[ ] I have tested every sample to ensure everything runs correctly. Not applicable.
[X] This PR describes the scope and expected impact of the changes I am making
Note: The Samples CI runs a number of checks including:
[X] I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
[X] My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions
Sample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:
[X] I have tested the sample on at least one compliant Vulkan implementation
[X] I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms. Tested on macOS Ventura 13.6.6 with Vulkan SDK 1.3.290/MoltenVK 1.2.9 as well as with MoltenVK 1.2.10 standalone (i.e. no Vulkan loader).
Description
This PR fixes the profiles sample on Apple platforms by doing the following:
VK_KHR_portability_enumeration
extension and flag during instance creation.VP_LUNARG_desktop_portability_2021_subset
profile on portability platforms. In addition to the standard desktop capabilities, this also checks the platform's portability subset features. UPDATE: Added an additional #ifdef guard to prevent build failures on iOS for current build configs (i.e. prior to merging my pending framework PR). This defensive check may become redundant in the future, but at least will be compatible and will not cause problems.fragmentStoresAndAtomics
,shaderStorageImageArrayDynamicIndexing
,textureCompressionBC
, andvertexPipelineStoresAndAtomics
. In addition, some limits are lower than required:maxPerStageDescriptorSampledImages = 96
,maxPerStageResources = 127
, andmaxPerStageDescriptorUpdateAfterBindInputAttachments = 96
, and finally some image formats and/or tiling capabilities are not supported (e.g. allVK_FORMAT_<*>_BLOCK
formats and some tiling features ofVK_FORMAT_R32G32B32A32_SFLOAT
,VK_FORMAT_R32G32_SFLOAT
,VK_FORMAT_R32_SFLOAT
).Note that all code changes are guarded by
VKB_ENABLE_PORTABILITY
, so it will only affect portability platforms.Fixes #1118
General Checklist:
Please ensure the following points are checked:
[X] This PR describes the scope and expected impact of the changes I am making
Note: The Samples CI runs a number of checks including:
Sample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: