-
Notifications
You must be signed in to change notification settings - Fork 351
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
Unhide inversesqrt() function in mx_math.metal #2010
Unhide inversesqrt() function in mx_math.metal #2010
Conversation
…ename function to mx_inversesqrt() to ensure no name clash with other shader generators. This is important for the Metal shdaer generation in Storms hdMetal backend.
… the metal code for now, to keep the types supported in line with each other.
Just for my own understanding, what is different about |
TL;DR - I think I don't claim to fully understand the backstory here - but the MaterialX code generator in Hydra storm for Metal does not set @jstone-lucasfilm - what do you think? Should we refactor the guard away completely, and just move to using |
@ld-kerley I believe the current design choice, using the If Storm is not currently setting this flag in Metal builds, then I can imagine two potential paths forward:
How challenging would it be to implement approach (1), where the guard is set in Storm? If that's not a practical solution, then I'm completely fine with pivoting to approach (2). |
I don't think it would be terribly hard to do (1), though getting the PR merged with Pixar can take some time sometimes. I think I'd vote for (2) though, as it will isolate us from potential future conflicts. Like the previous I think it would be good to merge this PR for now, so that anyone who happens to be trying to render OpenPBR, with Metal in Storm will get the fix, and I can put up another PR soon refactoring out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach sounds good to me, @ld-kerley, and let's move forward with this change, since it's the pattern that we intend to apply to other cross-platform functions in the future.
34907af
into
AcademySoftwareFoundation:main
inversesqrt()
is currently inside of a#ifdef __DECL_GL_MATH_FUNCTIONS__
guard, which means it is not visible inside of OpenUSD's Storm hdMetal backend.This PR moves it outside of the guard, and renames the function to
mx_inversesqrt()
to avoid possible name conflicts in other shader generators.