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

Metal ICBs for MultiDrawIndirect #1904

Closed
wants to merge 0 commits into from

Conversation

creijon
Copy link
Contributor

@creijon creijon commented Jun 13, 2022

Description of Change(s)

Implementation of Indirect Command Buffers (ICBs) to improve performance of multidraw indirect on the Metal implementation of the Storm renderer.

This brings significant savings on CPU time for complex scenes.

ICBs are encoded in a transform-feedback shader which is run as part of the Prepare phase of the PipelineDrawBatch. This generates a command state, held in the HgiMetalIndirectCommands structure, which contains the ICB, argument buffers, graphics pipeline and resource bindings necessary to execute the commands in the ExecuteDraw phase of the draw batch.

The implementation add a manager to HGI, the IndirectCommandEncoder. This is responsible for the lifetime of the transform feedback shaders, interfacing with the underlying Metal API and holding a pool of buffers to optimise the creation of the ICBs.

This includes the changes submitted in the previous PRs:

Known Issues(s)

  • On Apple Silicon machines running macOS before 12.3, a driver issue causes validation failure when the supportIndirectCommandBuffers flag is set. Therefore ICBs are not supported on these versions of macOS on Apple Silicon.

Fixes Issue(s)

  • CPU performance on Metal for complex scenes.
  • I have submitted a signed Contributor License Agreement

@creijon creijon changed the title ICB implementation for Metal Metal ICBs for MultiDrawIndirect Jun 13, 2022
@sunyab
Copy link
Contributor

sunyab commented Jun 13, 2022

Filed as internal issue #USD-7426

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.

2 participants