MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / GetTextureBlockWidth

Function GetTextureBlockWidth

Source/SysGL/Graphics/NativeTextureGL.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31static const u32 kPalette8BytesRequired = 256 * sizeof( NativePf8888 );
32
33static u32 GetTextureBlockWidth( u32 dimension, ETextureFormat texture_format )
34{
35 DAEDALUS_ASSERT( GetNextPowerOf2( dimension ) == dimension, "This is not a power of 2" );
36
37 // Ensure that the pitch is at least 16 bytes
38 while( CalcBytesRequired( dimension, texture_format ) < 16 )
39 {
40 dimension *= 2;
41 }
42
43 return dimension;
44}
45
46static inline u32 CorrectDimension( u32 dimension )
47{

Callers 1

CNativeTextureMethod · 0.70

Calls 2

GetNextPowerOf2Function · 0.85
CalcBytesRequiredFunction · 0.85

Tested by

no test coverage detected