feat: add etc1 codec#6
Open
guilhhotina wants to merge 3 commits into
Open
Conversation
Use wolfpld/etcpak 2.1 as the CPU ETC1 encoder because it provides maintained SIMD paths for x86 and NEON-friendly builds under BSD-3. Keep KTX/Basis container work out of this change; KTX is better suited for the GPU container issue and its ETC1 path goes through ETC1S transcode instead of a direct ETC1 encoder.
RodrigoDornelles
requested changes
Jun 11, 2026
RodrigoDornelles
left a comment
Member
There was a problem hiding this comment.
@guilhhotina essa implementação ta muito boa, só falta dar uma organizada nos arquivos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
adds cpu-side etc1 encode/decode support and initial gpu texture container support.
this covers issue #2 and the first-pass scope of issue #5 for single-image/mip0 payloads.
changes
Format::ETC1withEncode<ETC1>()andDecode<ETC1>()RGBA8888RGBA8888wolfpld/etcpak2.1 viaFetchContent_Populate-msse4.1only to etcpak sources when supported on x86Format::RGB565with encode/decode helpersKTX:RGBA8888,RGB565,ETC1PVR:RGBA8888,RGB565,ETC1KTX2:RGBA8888,RGB565,ETC1DDS:RGBA8888,RGB565DDSfrom acceptingETC1, since etc1 is not a standard dds payload formatvalidation
cmake -B build -DHAIO_TESTS=ONcmake --build build -j$(nproc)ctest --test-dir build -R '^(test_image_etc1_roundtrip|test_gpu_formats_roundtrip)$' --output-on-failure./build/test_image_convert_png_to_ppm assets/logo8x8.png build/logo8x8_direct.ppm./build/test_image_convert_png_to_etc1_ppm assets/logo8x8.png build/logo8x8_etc1.ppm16384cases11264casesetc1 roundtrip result:
sample files were also recognized by
fileas dds, pvr, ktx, and ktx2.notes
ctestwithout filters still fails for the two conversion binaries because they require input/output argv, but cmake registers them without arguments. the actual unit tests pass through ctest, and the conversion binaries pass when run manually with inputs.etcpak emits one vendor warning in
ProcessRGB.cpp; no haio warning was introduced.