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

Function MemoryAccessNumWords

source/val/validate_memory.cpp:242–248  ·  view source on GitHub ↗

Returns the number of instruction words taken up by a memory access argument and its implied operands.

Source from the content-addressed store, hash-verified

240// Returns the number of instruction words taken up by a memory access
241// argument and its implied operands.
242int MemoryAccessNumWords(uint32_t mask) {
243 int result = 1; // Count the mask
244 if (mask & uint32_t(spv::MemoryAccessMask::Aligned)) ++result;
245 if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) ++result;
246 if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) ++result;
247 return result;
248}
249
250// Returns the scope ID operand for MakeAvailable memory access with mask
251// at the given operand index.

Calls

no outgoing calls

Tested by

no test coverage detected