Skip to content

Commit b20e0d2

Browse files
matborzyszkowskiigcbot
authored andcommitted
Add flag to control dumping spvasm file
We need spvasm file only for debugging purposes, so we can disable it by default. This change refers to online compilation path
1 parent 84aeb2a commit b20e0d2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

IGC/AdaptorOCL/ocl_igc_interface/impl/igc_ocl_translation_ctx_impl.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,15 @@ CIF_DECLARE_INTERFACE_PIMPL(IgcOclTranslationCtx) : CIF::PimplBase
181181

182182
TC::DumpShaderFile(pOutputFolder, pInput, inputSize, hash, ".spv", nullptr);
183183
#if defined(IGC_SPIRV_TOOLS_ENABLED)
184-
spv_text spirvAsm = nullptr;
185-
if (TC::DisassembleSPIRV(pInput, inputSize, &spirvAsm) == SPV_SUCCESS)
184+
if (IGC_IS_FLAG_ENABLED(SpvAsmDumpEnable))
186185
{
187-
TC::DumpShaderFile(pOutputFolder, spirvAsm->str, spirvAsm->length, hash, ".spvasm", nullptr);
186+
spv_text spirvAsm = nullptr;
187+
if (TC::DisassembleSPIRV(pInput, inputSize, &spirvAsm) == SPV_SUCCESS)
188+
{
189+
TC::DumpShaderFile(pOutputFolder, spirvAsm->str, spirvAsm->length, hash, ".spvasm", nullptr);
190+
}
191+
spvTextDestroy(spirvAsm);
188192
}
189-
spvTextDestroy(spirvAsm);
190193
#endif // defined(IGC_SPIRV_TOOLS_ENABLED)
191194
}
192195
llvm::StringRef strInput = llvm::StringRef(pInput, inputSize);

0 commit comments

Comments
 (0)