Add macOS support for Vulkan applications#12
Open
ca1773130n wants to merge 1 commit intonvpro-samples:mainfrom
Open
Add macOS support for Vulkan applications#12ca1773130n wants to merge 1 commit intonvpro-samples:mainfrom
ca1773130n wants to merge 1 commit intonvpro-samples:mainfrom
Conversation
- Add Vulkan Portability extension support for instance creation - Add VK_EXT_metal_surface extension for macOS surface creation - Add volk platform defines for Metal (VK_USE_PLATFORM_METAL_EXT) - Add macOS detection for Slang compiler download - Exclude GNU-specific linker flags on macOS (--gc-sections, --disable-new-dtags) - Add <unistd.h> include for non-Windows platforms - Add Apple clang fallback for std::execution::par_unseq - Add __APPLE__ to Unix platform checks in timers - Fix std::min template deduction in nv_dds.cpp - Add native macOS file dialog implementation using NSOpenPanel/NSSavePanel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Cameleon X <ca1773130n@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive macOS support for building and running Vulkan applications using nvpro_core2.
Changes
nvvk/context.cpp): AddVK_KHR_portability_enumerationextension andVK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHRflag for non-conformant Vulkan implementations on macOSnvvk/context.cpp): AddVK_EXT_metal_surfacesupport inaddSurfaceExtensions()third_party/CMakeLists.txt): UseVK_USE_PLATFORM_METAL_EXTinstead of X11 defines on macOScmake/FindSlang.cmake): Add macOS detection for downloading correct binary; exclude GNU linker flagscmake/Setup.cmake): Exclude--gc-sectionson macOS (not supported by Apple linker)nvutils/logger.cpp): Add<unistd.h>for non-Windows platformsnvutils/parallel_work.hpp): Add fallback for Apple clang which lacksstd::execution::par_unseqnvutils/timers.cpp,nvutils/timers.hpp): Add__APPLE__to Unix platform checksnvimageformats/nv_dds.cpp): Explicit template parameter forstd::minto fix type mismatchnvgui/file_dialog_macos.mm,nvgui/CMakeLists.txt): Add macOS implementation usingNSOpenPanel/NSSavePanelTesting
Tested on:
Successfully built and ran vk_gaussian_splatting sample application.
Notes
#ifdef __APPLE__orelseif(APPLE)to avoid affecting other platforms