| 1127 | } |
| 1128 | |
| 1129 | std::string GetDebugSourceText(ValidationState_t& _, const Instruction* inst, |
| 1130 | uint32_t ext_inst_opcode) { |
| 1131 | assert(ext_inst_opcode == NonSemanticShaderDebugInfoDebugSource || |
| 1132 | ext_inst_opcode == NonSemanticShaderDebugInfoDebugSourceContinued); |
| 1133 | const uint32_t string_operand = |
| 1134 | (ext_inst_opcode == NonSemanticShaderDebugInfoDebugSource) ? 6 : 5; |
| 1135 | auto* debug_source_text_insn = _.FindDef(inst->word(string_operand)); |
| 1136 | // Validated to be an OpString |
| 1137 | assert(debug_source_text_insn->opcode() == spv::Op::OpString); |
| 1138 | return debug_source_text_insn->GetOperandAs<std::string>(1); |
| 1139 | } |
| 1140 | |
| 1141 | // We build up a vector that is length of the DebugSource lines and get how long |
| 1142 | // they are to make sure anyone using a DebugSource provides valid Line/Columns |
no test coverage detected