mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-24 21:55:09 +00:00
feat(materialx): Update source search path handling in shader generation
This commit is contained in:
@@ -57,6 +57,13 @@ ShaderPaths MaterialXShaderGenerator::Generate(const MaterialXConfig& config,
|
||||
if (!libraryPath.empty()) {
|
||||
searchPath.append(mx::FilePath(libraryPath.string()));
|
||||
}
|
||||
mx::FileSearchPath sourceSearchPath = searchPath;
|
||||
if (!libraryPath.empty() && libraryPath.filename() == "libraries") {
|
||||
std::filesystem::path libraryRoot = libraryPath.parent_path();
|
||||
if (!libraryRoot.empty()) {
|
||||
sourceSearchPath.append(mx::FilePath(libraryRoot.string()));
|
||||
}
|
||||
}
|
||||
if (logger_) {
|
||||
logger_->Trace("MaterialXShaderGenerator", "Generate",
|
||||
"libraryPath=" + libraryPath.string() +
|
||||
@@ -74,7 +81,7 @@ ShaderPaths MaterialXShaderGenerator::Generate(const MaterialXConfig& config,
|
||||
|
||||
mx::ShaderGeneratorPtr generator = mx::VkShaderGenerator::create();
|
||||
mx::GenContext context(generator);
|
||||
context.registerSourceCodeSearchPath(searchPath);
|
||||
context.registerSourceCodeSearchPath(sourceSearchPath);
|
||||
|
||||
mx::ShaderPtr shader;
|
||||
if (config.useConstantColor) {
|
||||
|
||||
Reference in New Issue
Block a user