Skip to content

Commit c7b5bb9

Browse files
authored
Update basis_universal to v2.1.0 (#9940)
1 parent 274d3d9 commit c7b5bb9

91 files changed

Lines changed: 161128 additions & 39619 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

libs/imageio/src/BasisEncoder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ BasisEncoder* Builder::build() {
169169
// an annotation that gets stored in the KTX2 file, which enables the app to choose the right
170170
// format when it loads and transcodes the texture. Technically however, the transcoder
171171
// SHOULD know about this, since in some scenarios it needs to interpolate between colors.
172-
params.m_ktx2_srgb_transfer_func = !mImpl->linear;
172+
params.m_ktx2_and_basis_srgb_transfer_function = !mImpl->linear;
173173

174174
// Select the same quality that the basis tool selects by default (midpoint of range).
175175
params.m_quality_level = 128;
@@ -181,7 +181,7 @@ BasisEncoder* Builder::build() {
181181
params.m_read_source_images = false;
182182

183183
// We do not want basis to write the file, we want to manually dump "get_output_ktx2_file()"
184-
params.m_write_output_basis_files = false;
184+
params.m_write_output_basis_or_ktx2_files = false;
185185

186186
basisu::basis_compressor* encoder = new basisu::basis_compressor();
187187

@@ -238,7 +238,7 @@ bool BasisEncoder::encode() {
238238
case basis_compressor::cECFailedFrontEnd:
239239
puts("Compressor frontend stage failed!");
240240
break;
241-
case basis_compressor::cECFailedFontendExtract:
241+
case basis_compressor::cECFailedFrontendExtract:
242242
puts("Compressor frontend data extraction failed!");
243243
break;
244244
case basis_compressor::cECFailedBackend:

libs/ktxreader/src/Ktx2Reader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static Result transcodeImageLevel(ktx2_transcoder& transcoder,
135135
if (formatInfo.isCompressed) {
136136
const uint32_t qwordsPerBlock = basisu::get_qwords_per_block(destFormat);
137137
const size_t byteCount = (size_t)sizeof(uint64_t) * (size_t)qwordsPerBlock * (size_t)levelInfo.m_total_blocks;
138-
138+
139139
if (qwordsPerBlock != 0 && levelInfo.m_total_blocks != 0 &&
140140
byteCount / qwordsPerBlock / sizeof(uint64_t) != levelInfo.m_total_blocks) {
141141
return Result::COMPRESSED_TRANSCODE_FAILURE;
@@ -156,13 +156,13 @@ static Result transcodeImageLevel(ktx2_transcoder& transcoder,
156156

157157
const uint32_t rowCount = levelInfo.m_orig_height;
158158
const uint32_t bytesPerPix = basis_get_bytes_per_block_or_pixel(formatInfo.basisFormat);
159-
159+
160160
if (bytesPerPix == 0) {
161161
return Result::UNCOMPRESSED_TRANSCODE_FAILURE;
162162
}
163163

164164
const size_t byteCount = (size_t)bytesPerPix * (size_t)levelInfo.m_orig_width * (size_t)rowCount;
165-
165+
166166
if (levelInfo.m_orig_width != 0 &&
167167
byteCount / bytesPerPix / levelInfo.m_orig_width != rowCount) {
168168
return Result::UNCOMPRESSED_TRANSCODE_FAILURE;
@@ -400,7 +400,7 @@ Texture* Ktx2Reader::createTexture(ktx2_transcoder* transcoder, const void* data
400400
if (!info.isSupported || info.transferFunction != transfer) {
401401
continue;
402402
}
403-
if (!basis_is_format_supported(info.basisFormat, transcoder->get_format())) {
403+
if (!basis_is_format_supported(info.basisFormat, transcoder->get_basis_tex_format())) {
404404
continue;
405405
}
406406
const uint32_t layerIndex = 0;

third_party/basisu/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2019-2026 Binomial LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

third_party/basisu/README.md

Lines changed: 416 additions & 191 deletions
Large diffs are not rendered by default.

third_party/basisu/basisu_tool.cpp

Lines changed: 4002 additions & 2143 deletions
Large diffs are not rendered by default.

third_party/basisu/basisu_tool_help.h

Lines changed: 715 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)