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

APPLE: Basis curves on Metal - Updated mega PR #2027

Conversation

slingthor
Copy link
Contributor

Description of Change(s)

  • Adds the PTCS stage
  • Adds shaders and handling of basis curves shader keys - attempts to join as much functionality with gl as possible
  • Passing of Tess factor buffers, and their pickup
  • Dispatch of PTCS stage and Tess factors in prepare with a new graphics pipeline
  • Addition of centroid / sampler handling for interstage interpolation
  • Vast Codegen changes to handle PTCS stage

Some of these changes are already split up and some are in flight of being merged in and changes from an earlier PR are already in to start supporting the PTCS stage - This one is a "mega PR" where everything can be looked at together and all latest feedback has been adhered to.
Incoming will be an updated split of the rest of the PTCS stage addition from this PR. With the outstanding changes to glslfx and shader function interface already split, that hopefully makes the change granular enough, to get it all in.

Fixes Issue(s)

  • Complex basis curves on Metal render
  • I have submitted a signed Contributor License Agreement

@slingthor slingthor changed the title Basis curves on Metal - Updated mega PR APPLE: Basis curves on Metal - Updated mega PR Sep 7, 2022
@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-7616

@pixar-oss pixar-oss closed this in 96301b7 Jan 25, 2023
pixar-oss pushed a commit that referenced this pull request Apr 3, 2023
Updated curve basis coefficient and array initialization to
use braced initializer list syntax since that is supported
for both GLSL and MSL.

Also, added some floating point literal suffixes to help
with overload resolution for MSL.

Contribution: Thor Hjalmarsson

Fixes #2027

(Internal change: 2268985)
pixar-oss pushed a commit that referenced this pull request Apr 3, 2023
This updates Storm codeGen for PTCS to be more consistent
with codeGen for PTVS. An additional simplification here
is to remove the use of ptvs_pv staging values for vertex
and varying primvar data. Now these are accessed directly
from input attributes or varying data buffers similar to
other kinds of shader stages.

Contribution: Thor Hjalmarsson, David G Yu

Fixes #2027

(Internal change: 2269369)
pixar-oss pushed a commit that referenced this pull request Apr 3, 2023
Implemented Storm support for the remaining refined drawing
modes for basisCurves and mesh geometry for HgiMetal.

Two significant differences with Metal tessellation are:
  1) need to pre-compute a buffer of tessellation factors.
  2) different attribute data access from PTVS vs VS/TCS.

For 1) we introduce a PostTessellationControl (PTCS) shader
which is a Metal PostTessellationVertex shader (PTVS) executed
with rasterization disabled to compute and store values into
a buffer of tessellation factors.

For 2) we're able to handle most data access differences within
Storm codeGen's accessor methods or within helper methods in
the shader source.

- Added HgiBindResourceTypeTessFactors to designate a buffer
binding for the tessFactors buffer.

- Updated HdSt_PipelineDrawBatch to allocate a tessFactors buffer
and execute PTCS shaders.

- Updated HgiMetal to bind the tessFactors buffer and execute
PTCS shaders.

- Updated Storm codeGen to support accessing varying data buffers
indexed using values from the primitive index buffer.

- Updated Storm basisCurves shader source and shaderKey to support
both VS/TCS/TES and PTCS/PTVS pipelines with most shader source
code shared in common between the two different kinds of pipelines.

- Updated Storm mesh shader source and shaderKey to support
PTCS/PTVS tessellation using OpenSubdiv surface evaluation.

Contribution: Thor Hjalmarsson, David G Yu

Fixes #2027

(Internal change: 2269604)
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