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

Function align

source/val/validate_decorations.cpp:152–154  ·  view source on GitHub ↗

Rounds x up to the next alignment. Assumes alignment is a power of two.

Source from the content-addressed store, hash-verified

150
151// Rounds x up to the next alignment. Assumes alignment is a power of two.
152uint32_t align(uint32_t x, uint32_t alignment) {
153 return (x + alignment - 1) & ~(alignment - 1);
154}
155
156// Returns base alignment of struct member. If |roundUp| is true, also
157// ensure that structs, arrays, and matrices are aligned at least to a

Callers 2

getBaseAlignmentFunction · 0.85
checkLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected