Commit Graph
213 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
Ben Polinsky 25e094e81d Fix missing cPackUASTC* constants in the WebGL encoder
The cPackUASTC* values are members of an anonymous enum. embind's
constant() registers a constant against the type of its value, and no
binding exists for an anonymous enum type. embind therefore waits for
that type forever, and the constants never appear on the module.
Module.cPackUASTCLevelDefault and the others are undefined in the
shipped basis_encoder.js.

Cast the values to uint32_t so that they bind as plain numbers.
EMBIND_AOT=1 makes this a link error ("Missing binding for type"), so
this change is also necessary to build the encoder with that flag.
2026-10-19 09:51:05 -04:00
Richard GeldreichandClaude Opus 4.8 018cc67cd0 webgl: add --slow option to build.sh for a serial build
--slow uses `make -j1` (one file at a time, the classic manual `make`)
instead of the default `make -j$(nproc)`. Useful for readable output or
constrained machines; parallel remains the default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 19:37:52 -04:00
Richard GeldreichandClaude Opus 4.8 b512234dff webgl: build.sh --clean runs 'make clean' before wiping the CMake cache
For a more thorough clean, --clean now runs `make clean` (removing the
build outputs and object files via the existing build system) before
deleting CMakeCache.txt/CMakeFiles and reconfiguring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 19:33:48 -04:00
Richard GeldreichandClaude Opus 4.8 fcab97d371 webgl: add build.sh to build the transcoder/encoder with Emscripten
Convenience script (place: webgl/build.sh) that runs emcmake/cmake/make
in webgl/transcoder/build and webgl/encoder/build. Stops on the first
error (set -euo pipefail), builds both by default or a named target
(transcoder/encoder), supports --clean and -D... cmake pass-through, is
runnable from any directory, and auto-sources emsdk if emcmake is not on
PATH.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 19:05:54 -04:00
Richard Geldreich 38168767f4 rebuilt artifacts 2026-07-18 18:11:39 -04:00
Richard Geldreich 1b33fd5098 Adding Cache-Control to dev web server to disable browser caching 2026-07-05 21:38:40 -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 6bec299da1 modified for v2.5 2026-07-01 12:59:35 -04:00
Richard Geldreich ad5cf81f47 adding new sample 2026-07-01 12:59:29 -04:00
Richard Geldreich 60c9e474ad adding new files 2026-07-01 12:59:16 -04:00
Richard Geldreich 4e32794532 moving ktx2_encode_test to ktx2_studio, adding new files 2026-07-01 12:59:08 -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 5273f2823b Adding save framebuffer as PNG checkbox 2026-03-19 00:35:03 -04:00
Richard Geldreich b27ae9d113 Mouse wheel now zooms in/out
Adding View R,G,B buttons
2026-03-19 00:07:38 -04:00
Richard Geldreich 35ec9ffe5e adding click dragging to texture viewer 2026-03-18 23:34:14 -04:00
Rich Geldreich 5bfe4fa793 Update README.md 2026-03-17 17:14:38 -04:00
Rich Geldreich 083f8d06f1 Update README.md 2026-03-17 17:14:13 -04:00
Richard Geldreich c7c2e2e714 setting static checks to manual, upping KTX2 WebGL testbed version 2026-03-06 19:21:19 -05:00
Richard Geldreich ab824725f9 rebuilt artifacts 2026-03-06 17:44:20 -05:00
Richard Geldreich c4d7061d58 changing encoding modal so it's a small dialog with no screen dimming 2026-03-03 02:18:28 -05:00
Richard Geldreich 162ea47e28 allowing astc/xuastc ldr format specific slider to go to effort 10, changing default to match unified effort's default (2) 2026-03-03 01:38:13 -05:00
Richard Geldreich ff13f01e64 build all artifacts 2026-03-03 01:30:44 -05:00
Richard Geldreich 367fb953cc bumping version 2026-03-03 01:21:37 -05:00
Richard Geldreich 6e0f0abf76 WebGL KTX2 viewer/compressor testbed: not always resetting mipmap level, cubemap index or layer index when encode button is pressed 2026-03-03 01:19:32 -05:00
Richard Geldreich 6e3b708ab6 adding mipmap options, tex array layer/cubemap index/mipmap level selection, file size display, display zooming, bilinear checkbox, other UI tweaks/fixes 2026-03-02 20:30:11 -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 2c4f52f705 Merge remote-tracking branch 'origin/master' 2026-02-23 15:57:41 -05:00
Richard Geldreich 13cc670a20 adding comment: we need to use sRGB vs. linear internal formats here 2026-02-23 15:57:38 -05:00
Rich Geldreich 136ac0185c Update README.md 2026-02-19 18:14:24 -05:00
Rich Geldreich 7cb7d1560e Update README.md 2026-02-19 18:13:57 -05:00
Rich Geldreich df1677b716 Update README.md 2026-02-19 18:13:07 -05:00
Rich Geldreich 33cfe3204c Update README.md 2026-02-19 18:11:45 -05:00
Rich Geldreich 8fabdf1305 Update README.md 2026-02-19 18:09:38 -05:00
Rich Geldreich 3a7343aa8e Update README.md 2026-02-19 18:07:10 -05:00
Rich Geldreich 10aaa50638 Update README.md 2026-02-19 18:06:03 -05:00