Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodesk: Lavapipe support on macOS #3121

Conversation

erikaharrison-adsk
Copy link
Contributor

Description of Change(s)

⚠ Note: This PR is for feature-hgi-vulkan branch.

The main goal is to enable Lavapipe (Vulkan driver) as a software rasterizer on all supported platforms, for testing purposes. This PR addresses macOS support by fixing some Vulkan instance and device creation issues/bugs.

Enabling MoltenVK support could be useful for testing, but it's not a priority, and there are issues with geometry shaders support preventing that, which this PR does not address. HgiVulkan currently assumes that geometry shaders are always supported, although it is actually an optional feature. If a feature check is added, then this could be fixed.

Lavapipe doesn't support Metal surfaces (VK_EXT_metal_surface), but display still works thanks to the HgiInterop Vulkan path:

  • After building the list of desired instance extensions, remove any that are not actually available. This mostly serves to remove the VK_EXT_metal_surface extension when using Lavapipe, since it doesn't support it.
  • Make the VK_KHR_swapchain device extension optional. It is not available if Lavapipe is built without any selected platforms, as it won't support any surface output.

Update Vulkan support to the latest recommendations for macOS, based on this document from LunarG:

  • Do no statically link with the MoltenVK libraries. The desired Vulkan driver should instead by loaded through the ICD loader. This is mandatory for loading the Lavapipe drivers.
  • Replace the deprecated VK_MVK_macos_surface instance extension with VK_EXT_metal_surface.
  • Add the VK_KHR_portability_enumeration instance extension on macOS. This is required for MoltenVK, but not for Lavapipe (it's a Vulkan 1.3 conformant implementation).
  • VK_EXT_descriptor_indexing is available on Lavapipe and MoltenVK (partial support), remove the conditional compilation for macOS.

With these changes, using Lavapipe, USDView launches and can display some test scenes, although more testing is required to identify remaining issues. Unit tests also all pass, although many graphics tests are skipped on macOS.

Fixes Issue(s)

  • N/A
  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9759

@jesschimein
Copy link
Contributor

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jesschimein
Copy link
Contributor

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@clach clach merged commit 80587a7 into PixarAnimationStudios:feature-hgi-vulkan Sep 3, 2024
5 checks passed
@erikaharrison-adsk erikaharrison-adsk deleted the adsk/bugfix/macos-vulkan branch September 18, 2024 23:41
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.

4 participants