MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / CMP_CalcMaxMipLevel

Function CMP_CalcMaxMipLevel

cmp_framework/common/cmp_mips.cpp:121–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121CMP_INT CMP_API CMP_CalcMaxMipLevel(CMP_INT nHeight, CMP_INT nWidth, CMP_BOOL bForGPU)
122{
123 CMP_INT MaxMipLevel = 1;
124 while (MaxMipLevel < MAX_MIPLEVEL_SUPPORTED && (nWidth > 1 || nHeight > 1))
125 {
126 nWidth = CMP_MAX(nWidth >> 1, 1);
127 nHeight = CMP_MAX(nHeight >> 1, 1);
128 if (bForGPU)
129 {
130 if ((nWidth % 4) || (nHeight % 4))
131 break;
132 }
133 MaxMipLevel++;
134 }
135
136 return MaxMipLevel;
137}
138
139CMP_ERROR CMP_API CMP_CreateCompressMipSet(CMP_MipSet* pMipSetCMP, CMP_MipSet* pMipSetSRC)
140{

Callers 5

CMP_ConvertMipTextureCGPFunction · 0.85
ProcessCMDLineFunction · 0.85
mipmap_tests.cppFile · 0.85
mainFunction · 0.85
CMP_CreateMipSetFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68