autodesk-forks / MaterialX

MaterialX C++ and Python libraries
http://www.materialx.org/
Apache License 2.0
107 stars 23 forks source link

Fix geomPropValue for GLSL to output varying vs unifom #1042

Closed bernardkwok closed 3 years ago

bernardkwok commented 4 years ago

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:

Follow-up:


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.

JGamache-autodesk commented 4 years ago

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 commented 4 years ago
bernardkwok commented 3 years ago

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 https://github.com/KhronosGroup/glslang/issues/940)