From 1d3a4e029d4c309cf1e37d283fb987897e24011d Mon Sep 17 00:00:00 2001 From: Rich Geldreich Date: Mon, 29 Apr 2019 19:24:28 -0700 Subject: [PATCH] Update readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3889816..d53ec37 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # basis_universal -Basis Universal GPU Texture Compressor +Basis Universal GPU Texture Compression Codec So far, we've compiled this using MSVS 2019, and under Ubuntu using cmake with either clang 3.8 or gcc 5.4. @@ -21,3 +21,14 @@ https://duckduckgo.com/?q=mali+texture+compression+tool&atb=v146-1&ia=web https://gpuopen.com/gaming-product/compressonator/ https://www.imgtec.com/developers/powervr-sdk-tools/pvrtextool/ +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: -fno-strict-aliasing + +To use the transcoder, #include "transcoder/basisu_transcoder.h" and "transcoder/basisu_global_selector_palette.h". Call basist::basisu_transcoder_init() a single time (probably at startup). Also, probably at startup, you need to create a single instance of the basist::etc1_global_selector_codebook class, like this: + +basist::etc1_global_selector_codebook sel_codebook(basist::g_global_selector_cb_size, basist::g_global_selector_cb); + +Now you can use the transcoder, which is implemented in the "basisu_transcoder" class in transcoder/basisu_transcoder.h. The key methods are start_decoding(), get_total_images(), get_image_info(), get_image_level_info(), and transcode_image_level(). + +I will be simplifying the transcoder so the caller doesn't need to deal with etc1_global_selector_codebook's next. + +transcode_image_level() and transcode_slice() are thread safe, i.e. you can decompressor multiple images/slices from multiple threads. start_decoding() is not thread safe.