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

Function GetArrayLength

source/val/validate_ray_tracing_reorder.cpp:30–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28static const uint32_t KRayParamInvalidId = std::numeric_limits<uint32_t>::max();
29
30uint32_t GetArrayLength(ValidationState_t& _, const Instruction* array_type) {
31 assert(array_type->opcode() == spv::Op::OpTypeArray);
32 uint32_t const_int_id = array_type->GetOperandAs<uint32_t>(2U);
33 Instruction* array_length_inst = _.FindDef(const_int_id);
34 uint32_t array_length = 0;
35 if (array_length_inst->opcode() == spv::Op::OpConstant) {
36 array_length = array_length_inst->GetOperandAs<uint32_t>(2);
37 }
38 return array_length;
39}
40
41spv_result_t ValidateRayQueryPointer(ValidationState_t& _,
42 const Instruction* inst,

Callers 2

RayReorderNVPassFunction · 0.70
RayReorderEXTPassFunction · 0.70

Calls 2

FindDefMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected