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

BC4 compression with R8 input results in a black texture #101

Open
tiiago11 opened this issue Apr 23, 2020 · 1 comment
Open

BC4 compression with R8 input results in a black texture #101

tiiago11 opened this issue Apr 23, 2020 · 1 comment
Assignees
Labels

Comments

@tiiago11
Copy link

@tiiago11 tiiago11 commented Apr 23, 2020

Hello,

After updating the library to v3.2.4691, it seems the BC4/ATI1N compression is producing a black texture when provided a R8 texture as input. This can be reproduced in the GUI and also with the SDK API.

As far as I could trace, the bufferIn.m_bSwizzle flag is wrongly set to true for this input format, which results in in the CCodecBuffer_R8::ReadBlockB getting called, which returns always 0 for this channel. The commit that introduced this verification of this flag in the CCodec_ATI1N::Compress_Fast codec is:
92f888f#diff-fc1b13a6a8de118ff844e5041f950301L121
A workaround I managed to do is to add CBT_R8 to the switch here:

Is this is a known issue? is there another fix/workaround that can be done from outside the library?

Thank you for the support!

@NPCompress NPCompress self-assigned this May 7, 2020
@NPCompress NPCompress added the bug label May 7, 2020
@NPCompress
Copy link
Collaborator

@NPCompress NPCompress commented May 7, 2020

@tiiago11 "Is this is a known issue? " No, its the first time been reported. The patch you used is applied to the release that is scheduled for next week.

"is there another fix/workaround that can be done from outside the library?" You can use the low -level BC4 block encoder available in CMP_Core.

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

Successfully merging a pull request may close this issue.

None yet
2 participants