Skip to content

Conversation

@qining
Copy link
Contributor

@qining qining commented Jun 22, 2018

So that BC4 and BC5 format images can be converted to RGBA8_UNORM format.

func decodeAlphaDXT5(r binary.Reader, dst []pixel) {
a0, a1, codes := int(r.Uint8()), int(r.Uint8()), uint64(r.Uint16())|(uint64(r.Uint32())<<16)
for i := 0; i < 16; i++ {
dst[i].a = mixAlphaDXT5(a0, a1, codes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignorable: I unfortunately suspect this might not inline, but I do side with readability / reuse than raw performance in this case.

@qining qining merged commit e270884 into google:master Jun 24, 2018
@qining qining deleted the bc4-format branch October 23, 2018 17:32
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

Successfully merging this pull request may close these issues.

2 participants