Commit Graph
45 Commits
Author SHA1 Message Date
Richard GeldreichandClaude Opus 5.5 9459482681 Build: compile Wuffs in its own translation unit (encoder/3rdparty/basisu_wuffs.cpp)
basisu_wuffs.cpp defines WUFFS_IMPLEMENTATION and #includes the unmodified
encoder/3rdparty/wuffs-v0.4.c with all warnings silenced in that TU only
(MSVC #pragma warning(push, 0)/pop; gcc/clang diagnostic push/ignored/pop).
basisu_wuffs_config.h holds the Wuffs configuration (modules BASE core/
interfaces/pixconv, ADLER32, CRC32, DEFLATE, ZLIB, PNG, JPEG, TARGA, QOI;
RGBA_NONPREMUL destination only; WUFFS_CONFIG__AVOID_CPU_ARCH = no SIMD), shared
with basisu_enc.cpp's declarations-only include (next commit). With
BASISU_USE_WUFFS_LDR_LOADER=0 the TU compiles to nothing.

Added to every build that compiles the encoder: root CMakeLists.txt
(native, -m32, WASI, Python module) with a BASISU_USE_WUFFS_LDR_LOADER option
(default ON), webgl/encoder/CMakeLists.txt (all Emscripten variants, same
option), and encoder_lib.vcxproj/.filters (basisu.sln: basisu, examples).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:55:17 -04:00
Richard GeldreichandClaude Opus 5.5 918d658f95 webgl encoder: accept mainScriptUrlOrBlob in threaded builds (Emscripten 6.0.x)
Newer Emscripten (6.0.x) no longer includes mainScriptUrlOrBlob in its default INCOMING_MODULE_JS_API,
so the threaded encoder loaded via importScripts() in ktx2_studio/encode-worker.js ignored it and the
pthread pool never came up (the worker hangs while loading). Add it explicitly (Emscripten's default list
plus mainScriptUrlOrBlob), as in the development tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:51:35 -04:00
Ben Polinsky b15211474d Add opt-in WebGL builds that do not use eval()/new Function()
With the default DYNAMIC_EXECUTION=1, embind generates its invokers at
runtime with new Function(). A Content-Security-Policy without
'unsafe-eval' blocks this, so the transcoder and encoder fail to start
with an EvalError.

Add two CMake options to webgl/transcoder and webgl/encoder:

- NO_DYNAMIC_EXECUTION (default OFF) adds -s DYNAMIC_EXECUTION=0.
- EMBIND_AOT (default ON, only used with NO_DYNAMIC_EXECUTION) adds
  -s EMBIND_AOT=1. This generates the invokers at build time, so
  embind calls stay as fast as with the default build.

The default build does not change. The .wasm output is byte-identical
in all configurations; only the JS glue changes.

Fixes #464
2026-10-19 09:51:05 -04:00
Richard Geldreich 38168767f4 rebuilt artifacts 2026-07-18 18:11:39 -04:00
Richard Geldreich fecef375e7 Compression parameter rename: renaming m_xuastc_ldr_channel_weights[] to m_ldr_channel_weights[] (it's no longer XUASTC/ASTC specific, it's also used for XUBC7 and DDS creation) 2026-07-03 22:03:05 -04:00
Richard Geldreich e79d46aadd rebuilt artifacts 2026-07-03 02:17:29 -04:00
Richard Geldreich 77677a5fd9 rebuilt artifacts 2026-07-01 13:52:13 -04:00
Richard Geldreich cee913ad4e modified for v2.5 2026-07-01 13:00:49 -04:00
Richard Geldreich 1e9ab1f575 rebuilt artifacts 2026-04-20 03:21:02 -04:00
Richard Geldreich 2280b753ce rebuilt artifacts 2026-04-20 03:00:48 -04:00
Richard Geldreich 801b67dbf3 rebuilt artifacts 2026-04-07 16:31:07 -04:00
Richard Geldreich 542ed6555d tinyexr: upgrading to latest library version. We no longer modify tinyexr, i.e. the tinyexr.h header we're using is now completely standard. We direct tinyexr's zlib calls to our fork of miniz internally. 2026-04-07 16:30:57 -04:00
Richard Geldreich b642cfa07b rebuilt all artifacts 2026-04-03 22:20:27 -04:00
Richard Geldreich 08fabab89f - fixing tinydds so it writes the correct flags, so dds-ktx can view our DDS files
- upping WebGL KTX2 encoder/transcoder testbed so its max Memory64/WASM64 heap size is 15GB, so 4096x4096 textures can be encoded
2026-03-20 17:34:22 -04:00
Richard Geldreich ab824725f9 rebuilt artifacts 2026-03-06 17:44:20 -05:00
Richard Geldreich ff13f01e64 build all artifacts 2026-03-03 01:30:44 -05:00
Richard Geldreich 4209505964 rebuild artifacts 2026-02-28 22:27:18 -05:00
Richard Geldreich cdd7bb0140 adding missing files 2026-02-28 18:34:32 -05:00
Richard Geldreich 1dbeaf032d minor typo fix 2026-02-28 03:47:25 -05:00
Richard Geldreich 54e129fe6a updating wasm/python builds 2026-02-24 22:28:31 -05:00
Richard Geldreich 81a4186404 v2.1 update for KTX-Software and Khronos file format KTX2 compatibility.
This update impacts the UASTC HDR 4x4, UASTC HDR 6x6i, and XUASTC LDR formats. New KTX2 files in these specific formats using v2.1 can't be loaded using v2.0, however we've kept backwards compatibility with all of our previously written KTX2 files. (v2.1 can transcode all previously written files.)
This is part of our effort to be compatible with Khronos's specification.
bc6hf encoder's smooth block path updated to handle inputs with texels close to MAX_HALF_FLOAT.
Adding command line options to basisu tool so it can write either v2.0 or v1.6 compatible UASTC HDR 6x6i files. The default is v1.6.
Updating WebGL KTX2 testbed so on ASTC devices it automatically switches between sRGB or linear internal formats for the created texture.
2026-02-24 20:35:11 -05:00
Richard Geldreich a6bf1c00f2 rebuilt 2026-01-19 02:22:47 -05:00
Richard Geldreich e93d3beb36 merging v2.0 from xuastc_private 2026-01-19 01:59:54 -05:00
Richard Geldreich ea6778b2b5 adding new files 2026-01-19 01:59:35 -05:00
Aaron Franke f3a63a3f54 Remove trailing space characters 2025-11-21 11:52:38 -08:00
Richard Geldreich 5179a06343 rebuild WASM 2025-11-18 17:24:25 -05:00
Richard Geldreich b1110111d4 adding -O3 to wasm linker options 2025-09-20 10:41:16 -04:00
Richard Geldreich e8855f8840 Compiler warning fixes.
Cleaning up handling of 8-byte lengths/offsets in KTX2 files. (In practice, we don't currently accept files this large anyway.)
2025-09-20 10:10:08 -04:00
Richard Geldreich b17dd2967c Rebuilt WASM execs with latest changes/fixes 2025-09-05 21:24:51 -04:00
Richard Geldreich 100ace82d2 emcc warning fixes, fixing warnings in WASM cmakelists.txt files, changing ETC1S encoder to use std::map vs. std::unordered_map for hopefully more cross platform determinism 2025-06-24 17:22:05 -04:00
Richard Geldreich 1ba75b4e34 ASTC 6x6 HDR/6x6 HDR intermediate update 2025-01-21 11:01:08 -05:00
Richard Geldreich 59d28d60e9 Fixing UASTC HDR DFD 2024-09-10 23:37:07 -04:00
Richard Geldreich a638316e37 Modifying UASTC HDR DFD 2024-09-10 20:52:23 -04:00
Richard Geldreich 731d54d549 UASTC HDR merge 2024-09-10 14:36:53 -04:00
Richard Geldreich 896b4f9878 UASTC HDR merge 2024-09-10 14:34:48 -04:00
Richard Geldreich 8078cb73a2 removing unused file 2024-09-10 14:34:37 -04:00
Richard Geldreich 7a2094b807 Adding SAN option to CMakeLists.txt, to make it easier to use clang's address/undefined behavior sanitizer on codebase
Fixing overflow issue on extreme colors in color_distance().
Explicitly disabling unaligned addressing in miniz and transcoder when UBSAN is enabled
Disabling a needless optimization in transcoder causing ubsan issues (that could have easily been worked around in a different way, but it was an unnecessary optimization to begin with)
Rebuild wasm builds
2022-02-24 19:45:01 -05:00
Richard Geldreich deeb5acb56 v1.16 release: OpenCL support, removing global selector palette code (it was unused/dead code), ETC1S encoding optimizations, -parallel command line option 2022-01-28 08:32:54 -05:00
Rich Geldreich 5337227c5d Rebuilt WASM encoder 2021-04-15 00:02:16 -04:00
Rich Geldreich ee626cec19 Adding initial support for user-provided mipmaps. This isn't hooked up to the command line tool or the JS wrappers yet. 2021-04-13 22:48:01 -04:00
Rich Geldreich 0b9cd40f3b Rebuild WASM files 2021-04-13 15:25:42 -04:00
Rich Geldreich 7f0a00afe1 Adding KTX2 transcoding/encoding/decompression to PNG/KTX1 support to the transcoder, encoder, JavaScript wrappers. This is also adding Zstandard to the repo, which is optional. Set BASISD_SUPPORT_KTX2_ZSTD=0 when compiling the encoder/transcoder to disable it, or from cmake set KTX2_ZSTANDARD=FALSE. 2021-04-12 13:30:45 -04:00
Rich Geldreich 2d4fe933b2 Basis Universal v1.13:
- Optimized ETC1S encoder (3-4.5x faster)
- Added optional SSE 4.1 support to encoder
- Switched from std::vector to a custom vector in the encoder and transcoder
- Added CppSPMD (SSE only for now)
- UASTC RDO is now more effective, but the command line parameter controlling qualiy has changed (to "lambda")
2021-03-09 11:00:25 -05:00
Rich Geldreich a21ea7f25b Adding missing files 2020-12-17 14:38:15 -05:00
Rich Geldreich 5eebb7e4f9 new files 2020-12-17 14:24:22 -05:00