Autodesk: Redirecting shader parameters #2789
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)