Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable unused parts of Basis Universal to improve build times and reduce binary sizes #56310

Closed
Calinou opened this issue Dec 29, 2021 · 4 comments · Fixed by #85321
Closed

Comments

@Calinou
Copy link
Member

Calinou commented Dec 29, 2021

Godot version

4.0.dev (28174d5)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

Right now, all the default features of Basis Universal are enabled at compile-time.

The above defines could all be set to 0 so that they are disabled at compile-time. Godot does not currently support displaying those compression formats, so they're of no use in the transcoder. (ASTC support may be considered in a future Godot release, but not for 4.0 as hardware adoption will still be too low when 4.0 is released.)

See https://github.com/BinomialLLC/basis_universal/wiki/How-to-Use-and-Configure-the-Transcoder#shrinking-the-transcoders-compiled-size.

Steps to reproduce

N/A

Minimal reproduction project

N/A

@Calinou
Copy link
Member Author

Calinou commented May 14, 2022

I've tried my hand at it: https://github.com/Calinou/godot/tree/basis-universal-disable-unused-features

The code compiles successfully, but the linking stage fails. Any ideas?

Linking Program bin/godot.linuxbsd.tools.64.llvm ...
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_astc_weights4
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_astc_weights5
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::astc_is_valid_endpoint_range(unsigned int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::astc_get_levels(int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::unquant_astc_endpoint_val(unsigned int, unsigned int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_astc_unquant
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_astc_unquant
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::g_astc_weights5
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_bc7enc.linuxbsd.tools.64.llvm.o): basist::astc_get_levels(int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_comp.linuxbsd.tools.64.llvm.o): basisu::uastc_rdo(unsigned int, basist::uastc_block*, basisu::color_rgba const*, basisu::uastc_rdo_params const&, unsigned int, basisu::job_pool*, unsigned int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_comp.linuxbsd.tools.64.llvm.o): basisu::encode_uastc(unsigned char const*, basist::uastc_block&, unsigned int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_table_anchor_index_third_subset_1
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_table_anchor_index_third_subset_2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_partition3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_table_anchor_index_second_subset
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_partition2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights4
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::unpack_uastc(basist::uastc_block const&, basist::color32*, bool)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights2
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights3
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights4
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basist::g_bc7_weights4
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basisu::pvrtc4_swizzle_uv(unsigned int, unsigned int, unsigned int, unsigned int)
mold: error: undefined symbol: modules/libmodule_basis_universal.linuxbsd.tools.64.llvm.a(basisu_gpu_texture.linuxbsd.tools.64.llvm.o): basisu::pvrtc4_image::get_pixel(unsigned int, unsigned int, unsigned int) const
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [bin/godot.linuxbsd.tools.64.llvm] Error 1
scons: building terminated because of errors.

@akien-mga akien-mga removed this from the 4.0 milestone Feb 22, 2023
@akien-mga
Copy link
Member

We now support and need ASTC, but indeed PVRTC could be disabled. I'm not sure the build time and binary size gains would be significant, but why not.

@fire
Copy link
Member

fire commented Jan 7, 2024

Since #56309 was merged and ASTC is required. This is closable?

@Calinou
Copy link
Member Author

Calinou commented Jan 9, 2024

Since #56309 was merged and ASTC is required. This is closable?

This issue is still relevant; see #85321.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants