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

Function ModuleLayoutPass

source/val/validate_layout.cpp:429–460  ·  view source on GitHub ↗

TODO(umar): Check linkage capabilities for function declarations TODO(umar): Better error messages NOTE: This function does not handle CFG related validation Performs logical layout validation. See Section 2.4

Source from the content-addressed store, hash-verified

427// NOTE: This function does not handle CFG related validation
428// Performs logical layout validation. See Section 2.4
429spv_result_t ModuleLayoutPass(ValidationState_t& _, const Instruction* inst) {
430 const spv::Op opcode = inst->opcode();
431
432 switch (_.current_layout_section()) {
433 case kLayoutCapabilities:
434 case kLayoutExtensions:
435 case kLayoutExtInstImport:
436 case kLayoutMemoryModel:
437 case kLayoutSamplerImageAddressMode:
438 case kLayoutEntryPoint:
439 case kLayoutExecutionMode:
440 case kLayoutDebug1:
441 case kLayoutDebug2:
442 case kLayoutDebug3:
443 case kLayoutAnnotations:
444 case kLayoutTypes:
445 if (auto error = ModuleScopedInstructions(_, inst, opcode)) return error;
446 break;
447 case kLayoutFunctionDeclarations:
448 case kLayoutFunctionDefinitions:
449 if (auto error = FunctionScopedInstructions(_, inst, opcode)) {
450 return error;
451 }
452 break;
453 case kLayoutGraphDefinitions:
454 if (auto error = GraphScopedInstructions(_, inst, opcode)) {
455 return error;
456 }
457 break;
458 }
459 return SPV_SUCCESS;
460}
461
462} // namespace val
463} // namespace spvtools

Calls 5

ModuleScopedInstructionsFunction · 0.85
GraphScopedInstructionsFunction · 0.85
opcodeMethod · 0.45

Tested by

no test coverage detected