floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.93k stars 487 forks source link

Additional texture pixel formats [BC3, BC7, ETC2 with sRGB, ASTC 4x4] #967

Closed allcreater closed 8 months ago

allcreater commented 8 months ago

This request is adding support for some broadly used compressed texture formats, which could be very useful with the basis_universal texture transcoding library.

Extended set of "known" formats with SRGB support:

4x4 subset is selected as the most broadly used and the only one of ASTC formats that is supported by the transcoding library.

floooh commented 8 months ago

Github Actions being wonky again :/ I just restarted the failed iOS job and it worked (previously it was failing to pull in a git submodule).

Ah, I was wondering exactly why only select the 4x4 block size for ASTC... thanks for pointing that out :)

I'll need to wrap up some work on the sokol-zig bindings (hopefully tomorrow evening) then I can look into your PR.

floooh commented 8 months ago

Giving it a quick test now...

floooh commented 8 months ago

And merged. Thanks!

Only thing I changed was moving the SRGB pixel formats closer to their non-SRGB equivalents in the sg_pixel_format enum, and a small if-else coding style change.