Skip to content

Commit c1dc59f

Browse files
committed
Disable unused Basis Universal features to reduce binary size
1 parent b2b13d4 commit c1dc59f

File tree

1 file changed

+20
-0
lines changed
  • modules/basis_universal

1 file changed

+20
-0
lines changed

modules/basis_universal/SCsub

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ if env.dev_build:
5050

5151
env_thirdparty = env_basisu.Clone()
5252
env_thirdparty.disable_warnings()
53+
54+
# Disable unneeded features to reduce binary size.
55+
# <https://github.com/BinomialLLC/basis_universal/wiki/How-to-Use-and-Configure-the-Transcoder>
56+
env_thirdparty.Append(
57+
CPPDEFINES=[
58+
# Storage formats.
59+
# Godot only implements `.basis` support through basis_universal.
60+
# Support for `.ktx` files are implemented with a direct libktx implementation.
61+
# Building the encoder requires `BASISD_SUPPORT_KTX2` to be enabled,
62+
# so we can only disable Zstandard compression for `.ktx` files
63+
# (this is not used in `.basis` files).
64+
("BASISD_SUPPORT_KTX2_ZSTD", 0),
65+
# GPU compression formats.
66+
("BASISD_SUPPORT_ATC", 0), # Proprietary Adreno format not supported by Godot.
67+
("BASISD_SUPPORT_FXT1", 0), # Legacy format not supported by Godot.
68+
("BASISD_SUPPORT_PVRTC1", 0), # Legacy format not supported by Godot.
69+
("BASISD_SUPPORT_PVRTC2", 0), # Legacy format not supported by Godot.
70+
]
71+
)
72+
5373
if env.editor_build:
5474
env_thirdparty.Append(CPPDEFINES=["BASISU_NO_IMG_LOADERS"])
5575
env_thirdparty.add_source_files(thirdparty_obj, encoder_sources)

0 commit comments

Comments
 (0)