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

Function CompressBlockBC4

cmp_core/shaders/bc4_encode_kernel.cpp:245–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245int CMP_CDECL CompressBlockBC4(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL)
246{
247 CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
248 CMP_BC15Options BC15optionsDefault;
249 if (BC15options == NULL)
250 {
251 BC15options = &BC15optionsDefault;
252 SetDefaultBC15Options(BC15options);
253 }
254
255 unsigned char inBlock[16];
256 //----------------------------------
257 // Fill the inBlock with source data
258 //----------------------------------
259 CGU_INT srcpos = 0;
260 CGU_INT dstptr = 0;
261 for (CGU_UINT8 row = 0; row < 4; row++)
262 {
263 srcpos = row * srcStrideInBytes;
264 for (CGU_UINT8 col = 0; col < 4; col++)
265 {
266 inBlock[dstptr++] = CGU_UINT8(srcBlock[srcpos++]);
267 }
268 }
269
270 CompressBlockBC4_SingleChannel(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options);
271 return CGU_CORE_OK;
272}
273
274int CMP_CDECL DecompressBlockBC4(const unsigned char cmpBlock[8], CMP_GLOBAL unsigned char srcBlock[16], const void* options = NULL)
275{

Callers 3

core_tests.cppFile · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

SetDefaultBC15OptionsFunction · 0.85

Tested by 1

mainFunction · 0.68