Make codec options externally configurable and remove BC7 support

This change makes it possible to exclude formats using compile time
options. BC7 is *never* exposed on the web and it has an absolutely huge
coding table which means we're just wasting space.

basis_transcoder.js 58707
basis_transcoder.wasm 224404
This commit is contained in:
Arseny Kapoulkine
2019-05-22 20:57:17 -07:00
parent 6fa7476bf9
commit f5d502912d
4 changed files with 21 additions and 7 deletions

View File

@@ -23,11 +23,25 @@
// Set to 1 for fuzz testing. This will disable all CRC16 checks on headers and compressed data.
#define BASISU_NO_HEADER_OR_DATA_CRC16_CHECKS 0
#define BASISD_SUPPORT_DXT1 1
#define BASISD_SUPPORT_DXT5A 1
#define BASISD_SUPPORT_BC7 1
#define BASISD_SUPPORT_PVRTC1 1
#define BASISD_SUPPORT_ETC2_EAC_A8 1
#ifndef BASISD_SUPPORT_DXT1
#define BASISD_SUPPORT_DXT1 1
#endif
#ifndef BASISD_SUPPORT_DXT5A
#define BASISD_SUPPORT_DXT5A 1
#endif
#ifndef BASISD_SUPPORT_BC7
#define BASISD_SUPPORT_BC7 1
#endif
#ifndef BASISD_SUPPORT_PVRTC1
#define BASISD_SUPPORT_PVRTC1 1
#endif
#ifndef BASISD_SUPPORT_ETC2_EAC_A8
#define BASISD_SUPPORT_ETC2_EAC_A8 1
#endif
#define BASISD_WRITE_NEW_BC7_TABLES 0
#define BASISD_WRITE_NEW_DXT1_TABLES 0

View File

@@ -15,5 +15,5 @@ if (EMSCRIPTEN)
set_target_properties(basis_transcoder.js PROPERTIES
OUTPUT_NAME "basis_transcoder"
SUFFIX ".js"
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -DNDEBUG")
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -DNDEBUG -DBASISD_SUPPORT_BC7=0")
endif()

File diff suppressed because one or more lines are too long