| 717 | } |
| 718 | |
| 719 | CommonDebugInfoInstructions 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 | |
| 744 | bool Instruction::IsValidBaseImage() const { |
| 745 | uint32_t tid = type_id(); |