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

Function CompressBlockBC1

cmp_core/shaders/bc1_encode_kernel.cpp:326–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326int CMP_CDECL CompressBlockBC1(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL)
327{
328 CMP_Vec4uc inBlock[16];
329
330 //----------------------------------
331 // Fill the inBlock with source data
332 //----------------------------------
333 CGU_INT srcpos = 0;
334 CGU_INT dstptr = 0;
335 for (CGU_UINT8 row = 0; row < 4; row++)
336 {
337 srcpos = row * srcStrideInBytes;
338 for (CGU_UINT8 col = 0; col < 4; col++)
339 {
340 inBlock[dstptr].x = CGU_UINT8(srcBlock[srcpos++]);
341 inBlock[dstptr].y = CGU_UINT8(srcBlock[srcpos++]);
342 inBlock[dstptr].z = CGU_UINT8(srcBlock[srcpos++]);
343 inBlock[dstptr].w = CGU_UINT8(srcBlock[srcpos++]);
344 dstptr++;
345 }
346 }
347
348 CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
349 CMP_BC15Options BC15optionsDefault;
350 if (BC15options == NULL)
351 {
352 BC15options = &BC15optionsDefault;
353 SetDefaultBC15Options(BC15options);
354 }
355
356 CompressBlockBC1_Internal(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options);
357 return CGU_CORE_OK;
358}
359
360int CMP_CDECL DecompressBlockBC1(const unsigned char cmpBlock[8], CMP_GLOBAL unsigned char srcBlock[64], const void* options = NULL)
361{

Callers 5

LoopedBC1CompressionFunction · 0.85
core_tests.cppFile · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

SetDefaultBC15OptionsFunction · 0.85

Tested by 2

LoopedBC1CompressionFunction · 0.68
mainFunction · 0.68