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

Function IsIntScalar

source/val/validate_extensions.cpp:63–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32,
64 bool must_unsigned) {
65 auto type = _.FindDef(id);
66 if (!type || type->opcode() != spv::Op::OpTypeInt) {
67 return false;
68 }
69
70 if (must_len32 && type->GetOperandAs<uint32_t>(1) != 32) {
71 return false;
72 }
73
74 return !must_unsigned || type->GetOperandAs<uint32_t>(2) == 0;
75}
76
77bool IsUint32Constant(ValidationState_t& _, uint32_t id) {
78 auto inst = _.FindDef(id);

Callers 3

IsUint32ConstantFunction · 0.85
ValidateExtInstDebugInfoFunction · 0.85

Calls 2

FindDefMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected