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

Function CompressBlockBC3

cmp_core/shaders/bc3_encode_kernel.cpp:157–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157int CMP_CDECL CompressBlockBC3(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[16], const void* options = NULL)
158{
159 CMP_Vec4uc inBlock[16];
160
161 //----------------------------------
162 // Fill the inBlock with source data
163 //----------------------------------
164 CGU_INT srcpos = 0;
165 CGU_INT dstptr = 0;
166 for (CGU_UINT8 row = 0; row < 4; row++)
167 {
168 srcpos = row * srcStrideInBytes;
169 for (CGU_UINT8 col = 0; col < 4; col++)
170 {
171 inBlock[dstptr].x = CGU_UINT8(srcBlock[srcpos++]);
172 inBlock[dstptr].y = CGU_UINT8(srcBlock[srcpos++]);
173 inBlock[dstptr].z = CGU_UINT8(srcBlock[srcpos++]);
174 inBlock[dstptr].w = CGU_UINT8(srcBlock[srcpos++]);
175 dstptr++;
176 }
177 }
178
179 CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
180 CMP_BC15Options BC15optionsDefault;
181 if (BC15options == NULL)
182 {
183 BC15options = &BC15optionsDefault;
184 SetDefaultBC15Options(BC15options);
185 }
186
187 CompressBlockBC3_Internal(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options);
188 return CGU_CORE_OK;
189}
190
191int CMP_CDECL DecompressBlockBC3(const unsigned char cmpBlock[16], CMP_GLOBAL unsigned char srcBlock[64], const void* options = NULL)
192{

Callers 3

core_tests.cppFile · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

SetDefaultBC15OptionsFunction · 0.85

Tested by 1

mainFunction · 0.68