MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / SpirvToolsStripDebugInfo

Function SpirvToolsStripDebugInfo

SPIRV/SpvTools.cpp:300–314  ·  view source on GitHub ↗

Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if optimization is disabled.

Source from the content-addressed store, hash-verified

298// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
299// optimization is disabled.
300void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate,
301 std::vector<unsigned int>& spirv, spv::SpvBuildLogger* logger)
302{
303 spv_target_env target_env = MapToSpirvToolsEnv(intermediate.getSpv(), logger);
304
305 spvtools::Optimizer optimizer(target_env);
306 optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
307
308 optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass());
309
310 spvtools::OptimizerOptions spvOptOptions;
311 optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger));
312 spvOptOptions.set_run_validator(false); // The validator may run as a separate step later on
313 optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
314}
315
316} // end namespace glslang
317

Callers 1

GlslangToSpvFunction · 0.85

Calls 3

MapToSpirvToolsEnvFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected