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

Function IsLogicalPointer

source/val/validate_logical_pointers.cpp:28–41  ·  view source on GitHub ↗

Returns true if inst is a logical pointer.

Source from the content-addressed store, hash-verified

26
27// Returns true if inst is a logical pointer.
28bool IsLogicalPointer(const ValidationState_t& _, const Instruction* inst) {
29 if (!_.IsPointerType(inst->type_id())) {
30 return false;
31 }
32
33 // Physical storage buffer pointers are not logical pointers.
34 auto type_inst = _.FindDef(inst->type_id());
35 auto sc = type_inst->GetOperandAs<spv::StorageClass>(1);
36 if (sc == spv::StorageClass::PhysicalStorageBuffer) {
37 return false;
38 }
39
40 return true;
41}
42
43// Returns true if inst is a variable pointer.
44// Caches the result in variable_pointers.

Callers 5

IsVariablePointerFunction · 0.85
ValidateVariablePointersFunction · 0.85
ValidateLogicalPointersFunction · 0.85

Calls 3

IsPointerTypeMethod · 0.80
FindDefMethod · 0.80
type_idMethod · 0.45

Tested by

no test coverage detected