mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
basis_universal: Sync with latest Git to solve more warnings
This commit is contained in:
parent
9a5d6d1049
commit
845f9f73cd
23 changed files with 297 additions and 405 deletions
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
index 1cc982b134..ab9a458744 100644
|
||||
index 2c314740cd..cee9c77ca0 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
@@ -29,7 +29,7 @@
|
||||
|
|
@ -11,7 +11,7 @@ index 1cc982b134..ab9a458744 100644
|
|||
|
||||
#ifndef MINIZ_HEADER_FILE_ONLY
|
||||
#define MINIZ_HEADER_FILE_ONLY
|
||||
@@ -3420,7 +3420,8 @@ namespace basisu
|
||||
@@ -3433,7 +3433,8 @@ namespace basisu
|
||||
float* out_rgba = nullptr;
|
||||
const char* err = nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
index 4d885cba16..6c2cf0260e 100644
|
||||
index cee9c77ca0..e9c8a01388 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp
|
||||
@@ -39,9 +39,6 @@
|
||||
|
|
@ -31,7 +31,7 @@ index 4d885cba16..6c2cf0260e 100644
|
|||
|
||||
bool load_png(const uint8_t *pBuf, size_t buf_size, image &img, const char *pFilename)
|
||||
diff --git a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
|
||||
index 339218fcf2..028ac3f314 100644
|
||||
index 3fa65b43c6..028ac3f314 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
|
||||
@@ -19,9 +19,6 @@
|
||||
|
|
@ -398,7 +398,7 @@ index 339218fcf2..028ac3f314 100644
|
|||
- goto failure;
|
||||
- }
|
||||
-
|
||||
- memcpy(hdr_mips[level].get_ptr(), pImage, image_size);
|
||||
- memcpy((void *)hdr_mips[level].get_ptr(), pImage, image_size);
|
||||
- }
|
||||
- else if (fmt == cRGBA_HALF)
|
||||
- {
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
diff --git a/thirdparty/basis_universal/transcoder/basisu_containers.h b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
index 03fae33974..7fff4c243e 100644
|
||||
--- a/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
+++ b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
@@ -3349,7 +3349,7 @@ namespace basisu
|
||||
|
||||
inline size_t hash_key(const Key& k) const
|
||||
{
|
||||
- assert((safe_shift_left(1ULL, (SIZE_T_BITS - m_hash_shift))) == m_values.size());
|
||||
+ assert((safe_shift_left(static_cast<uint64_t>(1), (SIZE_T_BITS - m_hash_shift))) == m_values.size());
|
||||
|
||||
// Fibonacci hashing
|
||||
if (SIZE_T_BITS == 32)
|
||||
@@ -3433,7 +3433,7 @@ namespace basisu
|
||||
return false;
|
||||
|
||||
new_map.m_hash_shift = SIZE_T_BITS - helpers::floor_log2i((uint64_t)new_hash_size);
|
||||
- assert(new_hash_size == safe_shift_left(1ULL, SIZE_T_BITS - new_map.m_hash_shift));
|
||||
+ assert(new_hash_size == safe_shift_left(static_cast<uint64_t>(1), SIZE_T_BITS - new_map.m_hash_shift));
|
||||
|
||||
new_map.m_grow_threshold = std::numeric_limits<size_t>::max();
|
||||
|
||||
142
thirdparty/basis_universal/patches/0004-clang-warning-exclude.patch
vendored
Normal file
142
thirdparty/basis_universal/patches/0004-clang-warning-exclude.patch
vendored
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
diff --git a/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h b/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
index a9fe6b27aa..4b8ffb0817 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
@@ -231,18 +231,7 @@ namespace basisu
|
||||
|
||||
inline void set_to_black()
|
||||
{
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
-#endif
|
||||
- memset(m_blocks.get_ptr(), 0, m_blocks.size_in_bytes());
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
-#endif
|
||||
+ memset((void *)m_blocks.get_ptr(), 0, m_blocks.size_in_bytes());
|
||||
}
|
||||
|
||||
inline bool get_block_uses_transparent_modulation(uint32_t bx, uint32_t by) const
|
||||
diff --git a/thirdparty/basis_universal/transcoder/basisu.h b/thirdparty/basis_universal/transcoder/basisu.h
|
||||
index e1f7161141..31b20d2734 100644
|
||||
--- a/thirdparty/basis_universal/transcoder/basisu.h
|
||||
+++ b/thirdparty/basis_universal/transcoder/basisu.h
|
||||
@@ -107,21 +107,8 @@ namespace basisu
|
||||
debug_puts(res.c_str());
|
||||
}
|
||||
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
template <typename T> inline void clear_obj(T& obj) { memset((void *)&obj, 0, sizeof(obj)); }
|
||||
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
constexpr double cPiD = 3.14159265358979323846264338327950288;
|
||||
constexpr float REALLY_SMALL_FLOAT_VAL = .000000125f;
|
||||
constexpr float SMALL_FLOAT_VAL = .0000125f;
|
||||
diff --git a/thirdparty/basis_universal/transcoder/basisu_containers.h b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
index 82b78cba62..9ea5917dfb 100644
|
||||
--- a/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
+++ b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
@@ -1503,22 +1503,10 @@ namespace basisu
|
||||
|
||||
if (BASISU_IS_BITWISE_COPYABLE(T))
|
||||
{
|
||||
-
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
-#endif
|
||||
if ((m_p) && (other.m_p))
|
||||
{
|
||||
- memcpy(m_p, other.m_p, m_size * sizeof(T));
|
||||
+ memcpy((void *)m_p, other.m_p, m_size * sizeof(T));
|
||||
}
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
-#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1649,19 +1637,8 @@ namespace basisu
|
||||
|
||||
if (BASISU_IS_BITWISE_COPYABLE(T))
|
||||
{
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
-#endif
|
||||
if ((m_p) && (other.m_p))
|
||||
memcpy((void *)m_p, other.m_p, other.m_size * sizeof(T));
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
-#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2233,21 +2210,7 @@ namespace basisu
|
||||
}
|
||||
|
||||
// Copy "down" the objects to preserve, filling in the empty slots.
|
||||
-
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
memmove((void *)pDst, pSrc, num_to_move * sizeof(T));
|
||||
-
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
-#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
-#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2492,18 +2455,13 @@ namespace basisu
|
||||
{
|
||||
if ((sizeof(T) == 1) && (scalar_type<T>::cFlag))
|
||||
{
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
-#endif
|
||||
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
memset(m_p, *reinterpret_cast<const uint8_t*>(&o), m_size);
|
||||
-
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
-#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
16
thirdparty/basis_universal/patches/0005-unused-typedef.patch
vendored
Normal file
16
thirdparty/basis_universal/patches/0005-unused-typedef.patch
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/thirdparty/basis_universal/encoder/basisu_enc.h b/thirdparty/basis_universal/encoder/basisu_enc.h
|
||||
index a565803e04..5256d34ad3 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_enc.h
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_enc.h
|
||||
@@ -2164,10 +2164,9 @@ namespace basisu
|
||||
uint32_t max_threads, job_pool *pJob_pool,
|
||||
bool even_odd_input_pairs_equal)
|
||||
{
|
||||
- typedef bit_hasher<typename Quantizer::training_vec_type> training_vec_bit_hasher;
|
||||
-
|
||||
// rg 6/24/2025 - Cross platform determinism
|
||||
#if 0
|
||||
+ typedef bit_hasher<typename Quantizer::training_vec_type> training_vec_bit_hasher;
|
||||
typedef std::unordered_map < typename Quantizer::training_vec_type, weighted_block_group,
|
||||
training_vec_bit_hasher> group_hash;
|
||||
#else
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
.../encoder/3rdparty/android_astc_decomp.cpp | 8 ++++----
|
||||
thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h | 4 ++--
|
||||
thirdparty/basis_universal/transcoder/basisu.h | 4 ++--
|
||||
.../basis_universal/transcoder/basisu_containers.h | 16 ++++++++--------
|
||||
4 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.cpp b/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.cpp
|
||||
index a667d0d637..742427c838 100644
|
||||
--- a/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.cpp
|
||||
+++ b/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.cpp
|
||||
@@ -837,7 +837,7 @@ void decodeISETritBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
||||
deUint32 T7 = data.getNext(1);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
#endif
|
||||
@@ -854,7 +854,7 @@ void decodeISETritBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
||||
DE_ASSERT(false);
|
||||
}
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
@@ -903,7 +903,7 @@ void decodeISEQuintBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
||||
deUint32 Q56 = data.getNext(2);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
#endif
|
||||
@@ -918,7 +918,7 @@ void decodeISEQuintBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
||||
DE_ASSERT(false);
|
||||
}
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
diff --git a/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h b/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
index a9fe6b27aa..356aaba97a 100644
|
||||
--- a/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
+++ b/thirdparty/basis_universal/encoder/basisu_pvrtc1_4.h
|
||||
@@ -232,14 +232,14 @@ namespace basisu
|
||||
inline void set_to_black()
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
#endif
|
||||
memset(m_blocks.get_ptr(), 0, m_blocks.size_in_bytes());
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
diff --git a/thirdparty/basis_universal/transcoder/basisu.h b/thirdparty/basis_universal/transcoder/basisu.h
|
||||
index 44fb9a3007..1dbf14ace3 100644
|
||||
--- a/thirdparty/basis_universal/transcoder/basisu.h
|
||||
+++ b/thirdparty/basis_universal/transcoder/basisu.h
|
||||
@@ -108,7 +108,7 @@ namespace basisu
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
@@ -117,7 +117,7 @@ namespace basisu
|
||||
template <typename T> inline void clear_obj(T& obj) { memset(&obj, 0, sizeof(obj)); }
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
diff --git a/thirdparty/basis_universal/transcoder/basisu_containers.h b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
index 7fff4c243e..d30736842a 100644
|
||||
--- a/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
+++ b/thirdparty/basis_universal/transcoder/basisu_containers.h
|
||||
@@ -1505,7 +1505,7 @@ namespace basisu
|
||||
{
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
@@ -1515,7 +1515,7 @@ namespace basisu
|
||||
memcpy(m_p, other.m_p, m_size * sizeof(T));
|
||||
}
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
@@ -1650,7 +1650,7 @@ namespace basisu
|
||||
if (BASISU_IS_BITWISE_COPYABLE(T))
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
@@ -1658,7 +1658,7 @@ namespace basisu
|
||||
if ((m_p) && (other.m_p))
|
||||
memcpy(m_p, other.m_p, other.m_size * sizeof(T));
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
@@ -2235,7 +2235,7 @@ namespace basisu
|
||||
// Copy "down" the objects to preserve, filling in the empty slots.
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
@@ -2244,7 +2244,7 @@ namespace basisu
|
||||
memmove(pDst, pSrc, num_to_move * sizeof(T));
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
@@ -2493,7 +2493,7 @@ namespace basisu
|
||||
if ((sizeof(T) == 1) && (scalar_type<T>::cFlag))
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
@@ -2501,7 +2501,7 @@ namespace basisu
|
||||
memset(m_p, *reinterpret_cast<const uint8_t*>(&o), m_size);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
-#ifdef __GNUC__
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue