Skip to content

Add macOS runtime support (skip unavailable mesh shaders and ray tracing)#22

Open
ca1773130n wants to merge 1 commit intonvpro-samples:mainfrom
ca1773130n:main
Open

Add macOS runtime support (skip unavailable mesh shaders and ray tracing)#22
ca1773130n wants to merge 1 commit intonvpro-samples:mainfrom
ca1773130n:main

Conversation

@ca1773130n
Copy link

Summary

This PR adds macOS runtime support for vk_gaussian_splatting by gracefully handling unavailable Vulkan extensions (mesh shaders, ray tracing) on MoltenVK.

Changes

  • Mesh shader pipeline guards (src/gaussian_splatting.cpp): Skip mesh shader pipeline creation on macOS with #ifndef __APPLE__
  • RTX acceleration structure guards (src/gaussian_splatting.cpp): Skip ray tracing initialization/deinitialization on macOS
  • Pipeline barrier guards (src/gaussian_splatting.cpp, src/splat_set_vk.cpp): Conditionally include VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT
  • Push constant guards (src/gaussian_splatting.cpp): Conditionally include VK_SHADER_STAGE_MESH_BIT_EXT
  • Optional extensions (src/main.cpp): Make mesh shader, ray tracing, and other unavailable extensions optional on macOS
  • Default pipeline (src/parameters.cpp): Default to PIPELINE_VERT on macOS since mesh shaders unavailable
  • Parallel execution fallback (src/splat_sorter_async.cpp): Fallback for Apple clang lacking std::execution::par_unseq
  • VMA API version (src/gaussian_splatting.cpp): Use VK_API_VERSION_1_2 for VMA on macOS

Testing

Tested on:

  • macOS 15.x (Apple Silicon M-series)
  • MoltenVK 1.4.0
  • Vulkan SDK 1.4.x

Successfully built and ran with the vertex shader rendering pipeline.

Notes

  • All changes are guarded with #ifdef __APPLE__ or #ifndef __APPLE__ to avoid affecting other platforms
  • The application falls back to vertex shader pipeline when mesh shaders are unavailable
  • Ray tracing features are disabled on macOS where acceleration structure extensions are unavailable

Related

This PR depends on nvpro_core2 macOS support: nvpro-samples/nvpro_core2#12

…navailable

- Guard mesh shader pipeline creation with #ifndef __APPLE__
- Guard all RTX acceleration structure initialization/deinitialization
- Skip initRtDescriptorSet and initRtPipeline on macOS
- Use VK_API_VERSION_1_2 for VMA on macOS (MoltenVK compatibility)
- Default to PIPELINE_VERT on macOS since mesh shaders unavailable
- Add parallel execution fallbacks for Apple clang (std::execution::par_unseq)
- Guard mesh shader stage flags in pipeline barriers and push constants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Cameleon X <ca1773130n@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant