Skip to content

Commit

Permalink
Resolve/adsk/bugfix/heightmapfix (PixarAnimationStudios#629)
Browse files Browse the repository at this point in the history
* Fix for shader compile error with mx::heighttonormal nodes
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

The root cause is that the filter kernels are uninitialized

const float c_box_filter_weights[84];
const float c_gaussian_filter_weights[84];

Also logged as USD github issue
PixarAnimationStudios#2281
* Update basefiles
* Add readme and helper script
  • Loading branch information
ashwinbhat authored and GitHub Enterprise committed Oct 11, 2023
1 parent 9ed3b23 commit b238f00
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pxr/imaging/hdSt/materialXShaderGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,12 +689,12 @@ HdStMaterialXShaderGen<Base>::_EmitConstantsUniformsAndTypeDefs(
Base::emitLineBreak(mxStage);
Base::emitTypeDefinitions(mxContext, mxStage);

// Add all constants
// Add all constants and ensure that values are initialized
const mx::VariableBlock& constants = mxStage.getConstantBlock();
if (!constants.empty()) {
emitVariableDeclarations(constants, constQualifier,
mx::Syntax::SEMICOLON,
mxContext, mxStage, false);
mxContext, mxStage, true);
Base::emitLineBreak(mxStage);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_002.usda -write baseline\Prism_002.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_005.usda -write baseline\Prism_005.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_013.usda -write baseline\Prism_013.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_026.usda -write baseline\Prism_026.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_042.usda -write baseline\Prism_042.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_048.usda -write baseline\Prism_048.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_066.usda -write baseline\Prism_066.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_105.usda -write baseline\Prism_105.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_119.usda -write baseline\Prism_119.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_132.usda -write baseline\Prism_132.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_134.usda -write baseline\Prism_134.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_152.usda -write baseline\Prism_152.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_159.usda -write baseline\Prism_159.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_171.usda -write baseline\Prism_171.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_198.usda -write baseline\Prism_198.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_207.usda -write baseline\Prism_207.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_227.usda -write baseline\Prism_227.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_247.usda -write baseline\Prism_247.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_253.usda -write baseline\Prism_253.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_334.usda -write baseline\Prism_334.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_360.usda -write baseline\Prism_360.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_397.usda -write baseline\Prism_397.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_399.usda -write baseline\Prism_399.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_414.usda -write baseline\Prism_414.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2000.usda -write baseline\Prism_2000.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2004.usda -write baseline\Prism_2004.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2011.usda -write baseline\Prism_2011.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2013.usda -write baseline\Prism_2013.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2016.usda -write baseline\Prism_2016.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2022.usda -write baseline\Prism_2022.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2023.usda -write baseline\Prism_2023.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## How to generate Base files
```
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_002.usda -write baseline\Prism_002.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_005.usda -write baseline\Prism_005.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_013.usda -write baseline\Prism_013.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_026.usda -write baseline\Prism_026.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_042.usda -write baseline\Prism_042.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_048.usda -write baseline\Prism_048.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_066.usda -write baseline\Prism_066.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_105.usda -write baseline\Prism_105.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_119.usda -write baseline\Prism_119.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_132.usda -write baseline\Prism_132.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_134.usda -write baseline\Prism_134.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_152.usda -write baseline\Prism_152.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_159.usda -write baseline\Prism_159.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_171.usda -write baseline\Prism_171.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_198.usda -write baseline\Prism_198.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_207.usda -write baseline\Prism_207.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_227.usda -write baseline\Prism_227.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_247.usda -write baseline\Prism_247.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_253.usda -write baseline\Prism_253.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_334.usda -write baseline\Prism_334.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_360.usda -write baseline\Prism_360.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_397.usda -write baseline\Prism_397.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_399.usda -write baseline\Prism_399.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_414.usda -write baseline\Prism_414.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2000.usda -write baseline\Prism_2000.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2004.usda -write baseline\Prism_2004.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2011.usda -write baseline\Prism_2011.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2013.usda -write baseline\Prism_2013.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2016.usda -write baseline\Prism_2016.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2022.usda -write baseline\Prism_2022.png
..\..\..\..\..\install\debug\tests\testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage Prism_2023.usda -write baseline\Prism_2023.png
```

0 comments on commit b238f00

Please sign in to comment.