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

Method Copy

cmp_compressonatorlib/buffer/codecbuffer.cpp:277–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void CCodecBuffer::Copy(CCodecBuffer& srcBuffer)
278{
279#ifdef USE_DBGTRACE
280 DbgTrace(("srcBuffer [%x]", srcBuffer));
281#endif
282 if (GetWidth() != srcBuffer.GetWidth() || GetHeight() != srcBuffer.GetHeight())
283 return;
284
285 const CMP_DWORD dwBlocksX = ((GetWidth() + 3) >> 2);
286 const CMP_DWORD dwBlocksY = ((GetHeight() + 3) >> 2);
287
288 for (CMP_DWORD j = 0; j < dwBlocksY; j++)
289 {
290 for (CMP_DWORD i = 0; i < dwBlocksX; i++)
291 {
292 float block[BLOCK_SIZE_4X4X4];
293 srcBuffer.ReadBlockRGBA(i * 4, j * 4, 4, 4, block);
294 WriteBlockRGBA(i * 4, j * 4, 4, 4, block);
295 }
296 }
297}
298
299#define MAX_BLOCK_WIDTH 8
300#define MAX_BLOCK_HEIGHT 8

Callers 2

CMP_ConvertTextureFunction · 0.45

Calls 3

GetWidthMethod · 0.45
GetHeightMethod · 0.45
ReadBlockRGBAMethod · 0.45

Tested by

no test coverage detected