Update readme

This commit is contained in:
Rich Geldreich
2019-04-30 20:52:51 -07:00
committed by GitHub
parent a541d55fa7
commit 59fa93f449

View File

@@ -43,6 +43,15 @@ The "WebGL" directory contains a very simple WebGL demo that uses the transcoder
On browsers that don't support BC1 (Firefox is one), there's a low-quality fallback code path for opaque textures (but no fallback for BC3 yet). Note that the fallback path only currently converts to 16-bit RGB images, so the quality isn't as good as it should be.
Note that I was unable to disable assertions when compiling the transcoder in release (-O2), and I'm not sure why yet. Currently, basisu.h forcefully disables the assert() macro, which is ugly but works:
`#if defined(__EMSCRIPTEN__) && !defined(_DEBUG) && !defined(DEBUG)
// HUGE HACK: I've been unable to disable assertions using emcc -O2 -s ASSERTIONS=0, no idea why.
// We definitely don't want them enabled in release.
#undef assert
#define assert(x) ((void)0)
#endif`
### Transcoder details
To use .basis files in an application, you only need the files in the "transcoder" directory. The entire transcoder lives in a single .cpp file: transcoder/basisu_transcoder.cpp. If compiling with gcc/clang, be sure strict aliasing is disabled when compiling this file, as I have not tested either the encoder or transcoder with strict aliasing enabled: -fno-strict-aliasing (The Linux kernel is also compiled with this option.)