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

Function GetArrayLength

source/val/validate_ray_query.cpp:26–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace {
25
26uint32_t GetArrayLength(ValidationState_t& _, const Instruction* array_type) {
27 assert(array_type->opcode() == spv::Op::OpTypeArray);
28 uint32_t const_int_id = array_type->GetOperandAs<uint32_t>(2U);
29 Instruction* array_length_inst = _.FindDef(const_int_id);
30 uint32_t array_length = 0;
31 if (array_length_inst->opcode() == spv::Op::OpConstant) {
32 array_length = array_length_inst->GetOperandAs<uint32_t>(2);
33 }
34 return array_length;
35}
36
37spv_result_t ValidateRayQueryPointer(ValidationState_t& _,
38 const Instruction* inst,

Callers 2

RayQueryPassFunction · 0.70

Calls 2

FindDefMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected