Avoid printing to stdout directly in library functions.
Previously GlslangToSpv() reported missing/TBD functionalities by directly writing to stdout using printf. That could cause problems to callers of GlslangToSpv(). This patch cleans up the error reporting logic in GlslangToSpv(), TGlslangToSpvTraverser, and spv::Builder a little bit to use ostringstream. Also fixed the usage of GlslangToSpv() in GTest fixtures to capture warnings/errors reported when translating AST to SPIR-V.
This commit is contained in:
@@ -38,6 +38,7 @@ namespace glslang {
|
||||
|
||||
void GetSpirvVersion(std::string&);
|
||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv);
|
||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv, std::string* messages);
|
||||
void OutputSpv(const std::vector<unsigned int>& spirv, const char* baseName);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user