Decouple GLSL and MSL "libraries" location. #1980
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently there is a dependency between the GLSL and MSL shader generation modules, because both targets share source code (which is great), the MSL shader generator uses files from the
genglsl
libraries locations.This becomes a small problem when building with USD, if the
MaterialXGenGLSL
module is not built, as the code usesMaterialXGenGLSL::TARGET
to generate thegenglsl
component in the file path.This PR aims to address this, by more correctly decoupling the MSL and GLSL shader generators, while still allowing the source code, and there only be a single copy of the code in the source repo, as well as make some of the cmake dependency tracking more robust.
All files shared between
genglsl
andgenmsl
have been moved from thegenglsl
location to a shared_hwCommon
location.The
libraries
CMakeLists.txt has been updated to "build" a staged folder from the source folder, wherelibaries
folder. This will result in smaller installations, where only one shader generator is desired._hwCommon
files are correctly copied to bothgenmsl
andgenglsl
.This also slightly simplifies the testing logic as we don't have to replicate the OSL legacy closure logic, and instead can just copy the staged files to the location for testing. The dependency tracking for copying the testing files is also fixed, so iterative edits to any of the files in
libraries
should be automatically installed to the testing location, previously this location would need to be deleted for cmake to copy the files.