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

Function CheckBlockDecoration

source/val/validate_decorations.cpp:2114–2126  ·  view source on GitHub ↗

Returns SPV_SUCCESS if validation rules are satisfied for the Block decoration. Otherwise emits a diagnostic and returns something other than SPV_SUCCESS.

Source from the content-addressed store, hash-verified

2112// decoration. Otherwise emits a diagnostic and returns something other than
2113// SPV_SUCCESS.
2114spv_result_t CheckBlockDecoration(ValidationState_t& vstate,
2115 const Instruction& inst,
2116 const Decoration& decoration) {
2117 assert(inst.id() && "Parser ensures the target of the decoration has an ID");
2118 if (inst.opcode() != spv::Op::OpTypeStruct) {
2119 const char* const dec_name = decoration.dec_type() == spv::Decoration::Block
2120 ? "Block"
2121 : "BufferBlock";
2122 return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
2123 << dec_name << " decoration on a non-struct type.";
2124 }
2125 return SPV_SUCCESS;
2126}
2127
2128spv_result_t CheckLocationDecoration(ValidationState_t& vstate,
2129 const Instruction& inst,

Callers 1

Calls 4

dec_typeMethod · 0.80
diagMethod · 0.80
idMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected