Fix VK_KHR_portability_subset validation errors on macOS, fix OpenMP build issues on macOS

(cherry picked from commit d2f6713c418ea5bdd2c3fcee922def5854e534d4)
This commit is contained in:
Stephen Saunders 2022-05-09 14:16:16 -04:00
parent 2810087752
commit ae8ad09f6e
3 changed files with 52 additions and 7 deletions

View file

@ -8,6 +8,10 @@
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
#if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
// SRS - This is needed to make visible VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME
#define VK_ENABLE_BETA_EXTENSIONS
#endif
#include <VulkanDevice.h>
#include <unordered_set>
@ -279,6 +283,14 @@ namespace vks
enableDebugMarkers = true;
}
#if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
// SRS - When running on iOS/macOS with MoltenVK, must enable the VK_KHR_portability_subset device extension
if (extensionSupported(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME))
{
deviceExtensions.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
}
#endif
if (deviceExtensions.size() > 0)
{
for (const char* enabledExtension : deviceExtensions)