MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetCommonDebugOpcode

Method GetCommonDebugOpcode

source/opt/instruction.cpp:719–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719CommonDebugInfoInstructions Instruction::GetCommonDebugOpcode() const {
720 if (opcode() != spv::Op::OpExtInst &&
721 opcode() != spv::Op::OpExtInstWithForwardRefsKHR) {
722 return CommonDebugInfoInstructionsMax;
723 }
724
725 const uint32_t opencl_set_id =
726 context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo();
727 const uint32_t shader_set_id =
728 context()->get_feature_mgr()->GetExtInstImportId_ShaderDebugInfo();
729
730 if (!opencl_set_id && !shader_set_id) {
731 return CommonDebugInfoInstructionsMax;
732 }
733
734 const uint32_t used_set_id = GetSingleWordInOperand(kExtInstSetIdInIdx);
735
736 if (used_set_id != opencl_set_id && used_set_id != shader_set_id) {
737 return CommonDebugInfoInstructionsMax;
738 }
739
740 return CommonDebugInfoInstructions(
741 GetSingleWordInOperand(kExtInstInstructionInIdx));
742}
743
744bool Instruction::IsValidBaseImage() const {
745 uint32_t tid = type_id();

Callers 15

IsDebugDeclareOrValueFunction · 0.80
UpdateUsesMethod · 0.80
HasOnlySupportedRefsMethod · 0.80
HasOnlySupportedRefsMethod · 0.80
ProcessGlobalValuesMethod · 0.80
HasOnlySupportedRefsMethod · 0.80
ReplaceVariableMethod · 0.80
CheckUsesMethod · 0.80

Tested by 1

TESTFunction · 0.64