MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / padn

Function padn

tools/ktx2check/ktx2check.cpp:503–505  ·  view source on GitHub ↗

Increase nbytes to make it a multiple of n. Works for any n.

Source from the content-addressed store, hash-verified

501
502// Increase nbytes to make it a multiple of n. Works for any n.
503size_t padn(uint32_t n, size_t nbytes) {
504 return (size_t)(n * ceilf((float)nbytes / n));
505}
506
507// Calculate number of bytes to add to nbytes to make it a multiple of n.
508// Works for any n.

Callers 4

calcLevelOffsetMethod · 0.85
validateHeaderMethod · 0.85
validateLevelIndexMethod · 0.85
validateKvdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected