Skip to content

basis_universal: Update to 1.60 #103968

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

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/basis_universal/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ basisu_encoder = env.editor_build
if basisu_encoder:
encoder_sources = [
"3rdparty/android_astc_decomp.cpp",
"basisu_astc_hdr_enc.cpp",
"basisu_astc_hdr_6x6_enc.cpp",
"basisu_astc_hdr_common.cpp",
"basisu_backend.cpp",
"basisu_basis_file.cpp",
"basisu_bc7enc.cpp",
"basisu_opencl.cpp",
"basisu_comp.cpp",
"basisu_enc.cpp",
"basisu_etc.cpp",
"basisu_frontend.cpp",
"basisu_gpu_texture.cpp",
"basisu_kernels_sse.cpp",
"basisu_opencl.cpp",
"basisu_pvrtc1_4.cpp",
"basisu_resampler.cpp",
"basisu_resample_filters.cpp",
"basisu_resampler.cpp",
"basisu_ssim.cpp",
"basisu_uastc_enc.cpp",
"basisu_uastc_hdr_4x4_enc.cpp",
"pvpngreader.cpp",
]
encoder_sources = [thirdparty_dir + "encoder/" + file for file in encoder_sources]
Expand Down
14 changes: 7 additions & 7 deletions modules/basis_universal/image_compress_basisu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedCha
basisu::basis_compressor_params params;

params.m_uastc = true;
params.m_quality_level = basisu::BASISU_QUALITY_MIN;
params.m_pack_uastc_flags &= ~basisu::cPackUASTCLevelMask;
params.m_pack_uastc_flags |= basisu::cPackUASTCLevelFastest;
params.m_etc1s_quality_level = basisu::BASISU_QUALITY_MIN;
params.m_pack_uastc_ldr_4x4_flags &= ~basisu::cPackUASTCLevelMask;
params.m_pack_uastc_ldr_4x4_flags |= basisu::cPackUASTCLevelFastest;

params.m_rdo_uastc = 0.0f;
params.m_rdo_uastc_quality_scalar = 0.0f;
params.m_rdo_uastc_dict_size = 1024;
params.m_rdo_uastc_ldr_4x4 = 0.0f;
params.m_rdo_uastc_ldr_4x4_quality_scalar = 0.0f;
params.m_rdo_uastc_ldr_4x4_dict_size = 1024;

params.m_mip_fast = true;
params.m_multithreading = true;
Expand All @@ -127,7 +127,7 @@ Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedCha
if (is_hdr) {
decompress_format = BASIS_DECOMPRESS_HDR_RGB;
params.m_hdr = true;
params.m_uastc_hdr_options.set_quality_level(0);
params.m_uastc_hdr_4x4_options.set_quality_level(0);

} else {
switch (p_channels) {
Expand Down
5 changes: 4 additions & 1 deletion thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Files extracted from upstream source:
## basis_universal

- Upstream: https://github.com/BinomialLLC/basis_universal
- Version: 1.50.0 (051ad6d8a64bb95a79e8601c317055fd1782ad3e, 2024)
- Version: 1.60 (323239a6a5ffa57d6570cfc403be99156e33a8b0, 2025)
- License: Apache 2.0

Files extracted from upstream source:
Expand All @@ -77,6 +77,8 @@ Patches:
- `0002-external-jpgd.patch` (GH-88508)
- `0003-external-tinyexr.patch` (GH-97582)
- `0004-remove-tinydds-qoi.patch` (GH-97582)
- `0005-windows-illegal-character.patch` (GH-103968)
- `0006-ambiguous-calls.patch` (GH-103968)


## brotli
Expand Down Expand Up @@ -512,6 +514,7 @@ Patches:

- `0001-external-basisu.patch` (GH-76572)
- `0002-disable-astc-block-ext.patch` (GH-76572)
- `0003-basisu-1.60.patch` (GH-103968)


## libogg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,12 @@ void decodeISETritBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
m[4] = data.getNext(numBits);
deUint32 T7 = data.getNext(1);

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
#endif
#endif
switch (numValues)
{
// \note Fall-throughs.
Expand All @@ -851,9 +853,11 @@ void decodeISETritBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
default:
DE_ASSERT(false);
}
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

const deUint32 T = (T7 << 7) | (T56 << 5) | (T4 << 4) | (T23 << 2) | (T01 << 0);

Expand Down Expand Up @@ -898,10 +902,12 @@ void decodeISEQuintBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
m[2] = data.getNext(numBits);
deUint32 Q56 = data.getNext(2);

#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
#endif
#endif
switch (numValues)
{
// \note Fall-throughs.
Expand All @@ -911,9 +917,11 @@ void decodeISEQuintBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
default:
DE_ASSERT(false);
}
#ifndef __EMSCRIPTEN__
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

const deUint32 Q = (Q56 << 5) | (Q34 << 3) | (Q012 << 0);

Expand Down
Loading