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
Labels
help wanted Indicates an issue where help and/or a pull request from the community would be very welcome

Comments

@DDoS
Copy link
Contributor

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
Contributor

Filed as internal issue #USD-10084

@nvmkuruc nvmkuruc added help wanted Indicates an issue where help and/or a pull request from the community would be very welcome good first issue Indicates a good issue for first-time contributors and removed good first issue Indicates a good issue for first-time contributors labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Indicates an issue where help and/or a pull request from the community would be very welcome
Projects
None yet
Development

No branches or pull requests

3 participants