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

Function IsAlignedTo

source/val/validate_decorations.cpp:431–434  ·  view source on GitHub ↗

Returns true if |offset| satsifies an alignment to |alignment|. In the case of |alignment| of zero, the |offset| must also be zero.

Source from the content-addressed store, hash-verified

429// Returns true if |offset| satsifies an alignment to |alignment|. In the case
430// of |alignment| of zero, the |offset| must also be zero.
431bool IsAlignedTo(uint32_t offset, uint32_t alignment) {
432 if (alignment == 0) return offset == 0;
433 return 0 == (offset % alignment);
434}
435
436// Returns SPV_SUCCESS if the given struct satisfies standard layout rules for
437// Block or BufferBlocks in Vulkan. Otherwise emits a diagnostic and returns

Callers 1

checkLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected