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

Function alignPow2

source/opt/struct_packing_pass.cpp:157–159  ·  view source on GitHub ↗

Aligns the specified value to a multiple of alignment, whereas the alignment must be a power-of-two.

Source from the content-addressed store, hash-verified

155// Aligns the specified value to a multiple of alignment, whereas the
156// alignment must be a power-of-two.
157static uint32_t alignPow2(uint32_t value, uint32_t alignment) {
158 return (value + alignment - 1) & ~(alignment - 1);
159}
160
161void StructPackingPass::buildConstantsMap() {
162 constantsMap_.clear();

Callers 3

getPackedSizeMethod · 0.85
getPackedArrayStrideMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected