GPUOpen-Tools / compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mipmap levels 2x2 are broken when generating BC1 textures

aerofly opened this issue · comments

Hello,

the current code when generating the mipmap level 2x2 for DXT1 textures is broken. The error is in the function

bool CCodecBuffer_RGB888::ReadBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, CMP_BYTE block[])

and this line

CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * dwWidth];

It should actually be

CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * w];

Otherwise the pixels are not properly duplicated into the 4x4 block. Some other ReadBlockRGBA functions also have this small issue.

This issue is probably also causing this

Can you confirm if this is actually a bug and if my fix is working properly?