Macos ios fixes (#1192)

* Configure MoltenVK to use a dedicated compute queue for compute[*] examples with sync barriers

* Modify descriptorindexing example for iOS and variable descriptor count limitations on MoltenVK

* Remove obsolete macOS #ifdefs no longer needed for modern MoltenVK versions

* Update iOS project to fix missing vkloader.c reference and revise example list

* Set required features and API version for VVL in debugprintf example

* Remove unnecessary Apple-specific code from descriptorindexing example

* Add Layer Settings capability to VulkanExampleBase::createInstance()

* Replace setenv() in examples with Layer Settings configuration for macOS/iOS

* Update comments in examples.h and fix missing initializer in computeraytracing example

* Update imgui overlay and example to support iOS Simulator

* Update more comments in examples.h and remove redundant initializers in deferred* examples

* Separate variable descriptor count declarations for apple and non-apple platforms

* Consolidate variable descriptor count declarations for apple vs. non-apple platforms

* Configure MoltenVK with a dedicated compute queue in VulkanExampleBase() and remove from samples
This commit is contained in:
SRSaunders 2025-03-29 11:21:37 -04:00 committed by GitHub
parent e1c962289f
commit 9a562a5426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 221 additions and 83 deletions

View file

@ -270,17 +270,6 @@ void VulkanSwapChain::create(uint32_t& width, uint32_t& height, bool vsync, bool
// Determine the number of images
uint32_t desiredNumberOfSwapchainImages = surfCaps.minImageCount + 1;
#if (defined(VK_USE_PLATFORM_MACOS_MVK) || defined(VK_USE_PLATFORM_METAL_EXT)) && defined(VK_EXAMPLE_XCODE_GENERATED)
// SRS - Work around known MoltenVK issue re 2x frame rate when vsync (VK_PRESENT_MODE_FIFO_KHR) enabled
struct utsname sysInfo;
uname(&sysInfo);
// SRS - When vsync is on, use minImageCount when not in fullscreen or when running on Apple Silcon
// This forces swapchain image acquire frame rate to match display vsync frame rate
if (vsync && (!fullscreen || strcmp(sysInfo.machine, "arm64") == 0))
{
desiredNumberOfSwapchainImages = surfCaps.minImageCount;
}
#endif
if ((surfCaps.maxImageCount > 0) && (desiredNumberOfSwapchainImages > surfCaps.maxImageCount))
{
desiredNumberOfSwapchainImages = surfCaps.maxImageCount;