Skip to content

Commit

Permalink
Further source code debugging for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Oct 24, 2024
1 parent c712dda commit f54c6d0
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ bool getShaderSource(mx::GenContext& context,
mx::FilePath resolvedPath = context.resolveSourceFile(sourcePath, localPath);
sourceContents = mx::readFile(resolvedPath);
resolvedSource = resolvedPath.asString();
if (sourcePath.asString().find("mx39_") != std::string::npos) {
std::cerr << "Resolving: " << sourcePath.asString() << std::endl;
std::cerr << "localPath: " << localPath.asString() << std::endl;
std::cerr << "resolvedPath: " << resolvedPath.asString() << std::endl;
}
return !sourceContents.empty();
}
return false;
Expand All @@ -75,19 +80,7 @@ void checkImplementations(mx::GenContext& context,

mx::FileSearchPath searchPath = mx::getDefaultDataSearchPath();
mx::DocumentPtr doc = mx::createDocument();
std::cerr << "Loading libraries" << std::endl;
const auto alllibs = loadLibraries({ "libraries/targets", "libraries/stdlib", "libraries/pbrlib" }, searchPath, doc);
for (const auto& mxlib: alllibs) {
std::cout << "\t" << mxlib << std::endl;
if (mxlib.find("genglsl/mx39_pbrlib") != std::string::npos) {
std::cerr << "\tAlso in this folder:" << std::endl;
mx::FilePath path(mxlib);
for (const auto& file : path.getParentPath().getFilesInDirectory("glsl"))
{
std::cerr << "\t\t" << file.asString() << std::endl;
}
}
}
loadLibraries({ "libraries/targets", "libraries/stdlib", "libraries/pbrlib" }, searchPath, doc);

const std::string& target = shadergen.getTarget();

Expand Down

0 comments on commit f54c6d0

Please sign in to comment.