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

Function CompressBlockBC4S

cmp_core/shaders/bc4_encode_kernel.cpp:202–229  ·  view source on GitHub ↗

prototype code

Source from the content-addressed store, hash-verified

200
201// prototype code
202int CMP_CDECL CompressBlockBC4S(const char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL)
203{
204 char inBlock[16];
205 //----------------------------------
206 // Fill the inBlock with source data
207 //----------------------------------
208 CGU_INT srcpos = 0;
209 CGU_INT dstptr = 0;
210 for (CGU_UINT8 row = 0; row < 4; row++)
211 {
212 srcpos = row * srcStrideInBytes;
213 for (CGU_UINT8 col = 0; col < 4; col++)
214 {
215 inBlock[dstptr++] = CGU_INT8(srcBlock[srcpos++]);
216 }
217 }
218
219 CMP_BC15Options* BC15options = (CMP_BC15Options*)options;
220 CMP_BC15Options BC15optionsDefault;
221 if (BC15options == NULL)
222 {
223 BC15options = &BC15optionsDefault;
224 SetDefaultBC15Options(BC15options);
225 }
226
227 CompressBlockBC4S_SingleChannel(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options);
228 return CGU_CORE_OK;
229}
230
231// prototype code
232int CMP_CDECL DecompressBlockBC4S(const unsigned char cmpBlock[8], CMP_GLOBAL char srcBlock[16], const void* options = NULL)

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

SetDefaultBC15OptionsFunction · 0.85

Tested by 1

mainFunction · 0.68