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

MaterialX shader codegen test baseline is platform depedent #3272

Open
DDoS opened this issue Sep 5, 2024 · 1 comment
Open

MaterialX shader codegen test baseline is platform depedent #3272

DDoS opened this issue Sep 5, 2024 · 1 comment

Comments

@DDoS
Copy link

DDoS commented Sep 5, 2024

Some of the MaterialX shader codegen uses unordered data structures, and this reflects in the output shader. This causes problems for tests which are comparing against a static baseline. For example, testHdStMaterialXShaderGen_UsdPStextured has these lines

    "textures": {
        "roughness": {
        },
        "diffuseColor": {
        }
    }, 

which will change order according to the stdlib implementation. On macOS, I observe

    "textures": {
        "diffuseColor": {
        },
        "roughness": {
        }
    }, 

and the test fails.

This is because the lines are printed in the order of _mxHdTextureMap, which is a MaterialX::StringMap aka std::unordered_map<std::string, std::string> (see pxr/imaging/hdSt/materialXShaderGen.cpp).

Either the testing baseline check needs to be smarter to handle undefined ordering where they can occur, or the codegen needs to sort the keys using the string values before printing.

@jesschimein
Copy link

Filed as internal issue #USD-10084

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

No branches or pull requests

2 participants