Add whitelist filtering for debug comments in SPIRV-Remap.

This commit is contained in:
ahagan
2022-04-26 23:36:57 -04:00
parent e3bca2add6
commit b5aae62731
4 changed files with 72 additions and 15 deletions

View File

@@ -367,11 +367,12 @@ public:
if (success && (controls & EShMsgSpvRules)) {
spv::SpvBuildLogger logger;
std::vector<std::string> whiteListStrings;
std::vector<uint32_t> spirv_binary;
glslang::GlslangToSpv(*program.getIntermediate(stage),
spirv_binary, &logger, &options());
spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions);
spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, whiteListStrings, remapOptions);
std::ostringstream disassembly_stream;
spv::Parameterize();
@@ -394,9 +395,9 @@ public:
{
if ((controls & EShMsgSpvRules)) {
std::vector<uint32_t> spirv_binary(code); // scratch copy
std::vector<std::string> whiteListStrings;
spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, whiteListStrings, remapOptions);
spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions);
std::ostringstream disassembly_stream;
spv::Parameterize();
spv::Disassemble(disassembly_stream, spirv_binary);