Open ashwinbhat opened 1 year ago
Attached is the shader dump. program27_shader0_FRAGMENT_SHADER.glsl.txt
The filter kernels are uninitialized
const float c_box_filter_weights[84];
const float c_gaussian_filter_weights[84];
Adding a quick fix locally to initialize variables on emitVariableDeclarations seems to do it. https://github.com/PixarAnimationStudios/USD/blob/5c5ebddff35012461a2b0ba773c47f05730cbab4/pxr/imaging/hdSt/materialXShaderGen.cpp#L294-L296
Filed as internal issue #USD-8019
To clarify:
emitVariableDeclarations(constants, _syntax->getConstantQualifier(),
mx::Syntax::SEMICOLON,
mxContext, mxStage, true);
Works, but I'm not sure if this will break others use cases.
Description of Issue
When we use MaterialX heighttonormal node to convert a height map to normal map, Storm reports a shader error. error C7522: OpenGL requires constants to be initialized
Steps to Reproduce
System Information (OS, Hardware)
Windows x64
Package Versions
USD Dev at 1d2f18b
Build Flags
--tests --openimageio --opencolorio --materialx