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: Redirecting shader parameters #2789

Merged

Conversation

erikaharrison-adsk
Copy link
Contributor

Description of Change(s)

Revert change 68dec0df and use the correct way to resolve the issue for redirecting shader parameters.

The change 68dec0df is because if a shader parameter has the same name as the primvar, it will redirect to the primvar. If the primvar doesn't emit scalar accessor, the shader parameter must define the scalar accessor for Mac platform. This change has a problem when the primvar has already emitted the scalar accessor. For example, if EmitAccessor is called, it will then call EmitScalarAccessor. In this case, there will be both the scalar accessor for primvar and the scalar accessor for shader parameter. As the name for the primvar and the shader parameter is the same, the two scalar accessor function will be duplicated. The correct solution is that every primvar that has the potential scalar access must provide the scalar accessor. In this change, we add EmitScalarAccessor to EmitStageAccessor and EmitStructAccessor. We may also need to add to _EmitComputeAccessor and _EmitBufferAccessor, but we can wait until we meet with the problem.

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

…r redirect shader parameters.

The change 68dec0d is because if a shader parameter has the same name as the primvar, it will redirect to the primvar. If the primvar doesn't emit scalar accessor, the shader parameter must define the scalar accessor for Mac platform.
This change has a problem when the primvar has already emitted the scalar accessor. For example, if EmitAccessor is called, it will then call EmitScalarAccessor. In this case, there will be both the scalar accessor for primvar and the scalar accessor for shader parameter. As the name for the primvar and the shader parameter is the same, the two scalar accessor function will be duplicated.
The correct solution is that every primvar that has the potentil scalar access must provide the scalar accessor. In my change, I add EmitScalarAccessor to EmitStageAccessor and EmitStructAccessor.
@jesschimein
Copy link
Contributor

Filed as internal issue #USD-8915

@erikaharrison-adsk
Copy link
Contributor Author

Hi @jesschimein or is there another person I should tag? Any update on this PR? We've a shipping product that's looking to incorporate this work. Let us know if there's anything on our end we can do to help this along.

@pixar-oss pixar-oss merged commit 0139383 into PixarAnimationStudios:dev Mar 26, 2024
5 checks passed
@erikaharrison-adsk erikaharrison-adsk deleted the adsk/bugfix/ScalarAccessor branch April 16, 2024 23:45
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