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

Function ValidateCommitPipe

source/val/validate_pipe.cpp:215–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215spv_result_t ValidateCommitPipe(ValidationState_t& _, const Instruction* inst) {
216 if (inst->opcode() == spv::Op::OpCommitReadPipe) {
217 if (auto error = ValidatePipeType(_, inst, 0, ValidPipeType::READ_ONLY))
218 return error;
219 } else if (inst->opcode() == spv::Op::OpCommitWritePipe) {
220 if (auto error = ValidatePipeType(_, inst, 0, ValidPipeType::WRITE_ONLY))
221 return error;
222 }
223
224 const Instruction* reserve_id = _.FindDef(_.GetOperandTypeId(inst, 1));
225 if (reserve_id->opcode() != spv::Op::OpTypeReserveId) {
226 return _.diag(SPV_ERROR_INVALID_DATA, inst)
227 << "Reserve Id type must be OpTypeReserveId.";
228 }
229
230 if (auto error = ValidatePacketSizeAlign(_, inst, 2, 3)) return error;
231
232 return SPV_SUCCESS;
233}
234
235spv_result_t ValidateGroupCommitPipe(ValidationState_t& _,
236 const Instruction* inst) {

Callers 1

PipePassFunction · 0.85

Calls 6

ValidatePipeTypeFunction · 0.85
ValidatePacketSizeAlignFunction · 0.85
FindDefMethod · 0.80
GetOperandTypeIdMethod · 0.80
diagMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected