Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mipmap levels 2x2 are broken when generating BC1 textures #315

Open
aerofly opened this issue Apr 17, 2024 · 0 comments
Open

Mipmap levels 2x2 are broken when generating BC1 textures #315

aerofly opened this issue Apr 17, 2024 · 0 comments

Comments

@aerofly
Copy link

aerofly commented Apr 17, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant