Create a new logger class for all messages w.r.t. SPIR-V build.

This commit is contained in:
Lei Zhang
2016-05-04 15:55:59 -04:00
parent 09caf12bec
commit 17535f7d55
10 changed files with 184 additions and 61 deletions

View File

@@ -188,19 +188,19 @@ public:
program.addShader(&shader);
success &= program.link(messages);
std::string spirvWarningsErrors;
spv::SpvBuildLogger logger;
if (success && target == Target::Spirv) {
std::vector<uint32_t> spirv_binary;
glslang::GlslangToSpv(*program.getIntermediate(language),
spirv_binary, &spirvWarningsErrors);
spirv_binary, &logger);
std::ostringstream disassembly_stream;
spv::Parameterize();
spv::Disassemble(disassembly_stream, spirv_binary);
return {shader.getInfoLog(), shader.getInfoDebugLog(),
program.getInfoLog(), program.getInfoDebugLog(),
spirvWarningsErrors, disassembly_stream.str()};
logger.getAllMessages(), disassembly_stream.str()};
} else {
return {shader.getInfoLog(), shader.getInfoDebugLog(),
program.getInfoLog(), program.getInfoDebugLog(),