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

Fix geomPropValue for GLSL to output varying vs unifom #1042

Closed
bernardkwok opened this issue Dec 1, 2020 · 3 comments · Fixed by #1046
Closed

Fix geomPropValue for GLSL to output varying vs unifom #1042

bernardkwok opened this issue Dec 1, 2020 · 3 comments · Fixed by #1046
Assignees
Labels
ShaderGen Shader Generation change required
Milestone

Comments

@bernardkwok
Copy link

bernardkwok commented Dec 1, 2020

Currently the custom GLSL code generation node (MaterialXGenGlsl\Nodes\GeomPropValueNodeGlsl.cpp)
is outputting a uniform instead of a varying parameter. This should be changed to output a varying to match
the current specification (as of v1.38).

Work:

  • Fixes to GeomPropValueNodeGLSL.cpp
  • Testing for raw glsl, ogsfx, and ogsxml variants.

Follow-up:

  • Checking that this will still work with SPIR-V cross-compilation.

Whether to extend geomPropValue to indicate that the input is a uniform is a separate issue beyond the scope of this fix.
A placeholder item can be found here: #1051.

@bernardkwok bernardkwok added the ShaderGen Shader Generation change required label Dec 1, 2020
@bernardkwok bernardkwok added this to the 1.38 milestone Dec 1, 2020
@JGamache-autodesk
Copy link
Collaborator

Testing raises some questions about handling invalid types in GLSL. What should be the GLSL code output for types bool and string?
Also there is a requirement to add the keyword flat to integer varying inputs. Easy to implement, but might trip the HLSL converter.

@bernardkwok
Copy link
Author

bernardkwok commented Dec 1, 2020

  • For the first point, as you can't have boolean or string vertex streams we could leave these as uniforms. We are no worse off than before. Any language which does not support "string" we output integers instead and leave it up the the binding process to determine the string->integer mapping.
  • As for integer streams, I'm not sure of the frequency of these so maybe we could also defer this for now and also just keep them as uniforms.
  • Which leaves us with 2-4 channel float support.

@bernardkwok
Copy link
Author

Pulling out a note from PR as there was a possible concern with adding in the "flat" qualifier for integer varyings. Seems this is a non-issue (See KhronosGroup/glslang#940)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ShaderGen Shader Generation change required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants