mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Compare commits
28 commits
9a5d6d1049
...
295e465fe4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
295e465fe4 | ||
![]() |
91a1798474 | ||
![]() |
aa88eb2a75 | ||
![]() |
3f3a8562fb | ||
![]() |
db3407370c | ||
![]() |
09ea0cf899 | ||
![]() |
092b7c6427 | ||
![]() |
c41e47034e | ||
![]() |
4ab22026b6 | ||
![]() |
894d6ba13f | ||
![]() |
5913469309 | ||
![]() |
755934f5f0 | ||
![]() |
538fd69243 | ||
![]() |
7efb51c9d3 | ||
![]() |
a299004622 | ||
![]() |
845f9f73cd | ||
![]() |
cee37f0234 | ||
![]() |
9843a016f5 | ||
![]() |
bd9d1bf070 | ||
![]() |
33cc3c125d | ||
![]() |
33689d7beb | ||
![]() |
f9fc0a243c | ||
![]() |
7fe3a661b4 | ||
![]() |
f678729f89 | ||
![]() |
839e0358b3 | ||
![]() |
4986e28bef | ||
![]() |
65a00fc60a | ||
![]() |
1036bfd7ad |
98 changed files with 857 additions and 701 deletions
|
@ -214,7 +214,7 @@ License: Apache-2.0
|
|||
|
||||
Files: thirdparty/basis_universal/*
|
||||
Comment: Basis Universal
|
||||
Copyright: 2019-2024, Binomial LLC.
|
||||
Copyright: 2019-2025, Binomial LLC.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: thirdparty/brotli/*
|
||||
|
|
|
@ -181,8 +181,8 @@ void register_core_types() {
|
|||
|
||||
GDREGISTER_CLASS(Shortcut);
|
||||
GDREGISTER_ABSTRACT_CLASS(InputEvent);
|
||||
GDREGISTER_ABSTRACT_CLASS(InputEventWithModifiers);
|
||||
GDREGISTER_ABSTRACT_CLASS(InputEventFromWindow);
|
||||
GDREGISTER_ABSTRACT_CLASS(InputEventWithModifiers);
|
||||
GDREGISTER_CLASS(InputEventKey);
|
||||
GDREGISTER_CLASS(InputEventShortcut);
|
||||
GDREGISTER_ABSTRACT_CLASS(InputEventMouse);
|
||||
|
|
|
@ -30,8 +30,9 @@
|
|||
|
||||
#include "ustring.h"
|
||||
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Dictionary);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Array);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Dictionary);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Object);
|
||||
|
||||
#include "core/crypto/crypto_core.h"
|
||||
#include "core/math/color.h"
|
||||
|
|
151
core/templates/hashfuncs.cpp
Normal file
151
core/templates/hashfuncs.cpp
Normal file
|
@ -0,0 +1,151 @@
|
|||
/**************************************************************************/
|
||||
/* hashfuncs.cpp */
|
||||
/**************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/**************************************************************************/
|
||||
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
|
||||
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#include "hashfuncs.h"
|
||||
|
||||
uint32_t hash_murmur3_one_float(float p_in, uint32_t p_seed) {
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.f = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.f = Math::NaN;
|
||||
} else {
|
||||
u.f = p_in;
|
||||
}
|
||||
|
||||
return hash_murmur3_one_32(u.i, p_seed);
|
||||
}
|
||||
|
||||
uint32_t hash_murmur3_one_double(double p_in, uint32_t p_seed) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return hash_murmur3_one_64(u.i, p_seed);
|
||||
}
|
||||
|
||||
uint32_t hash_murmur3_buffer(const void *key, int length, const uint32_t seed) {
|
||||
// Although not required, this is a random prime number.
|
||||
const uint8_t *data = (const uint8_t *)key;
|
||||
const int nblocks = length / 4;
|
||||
|
||||
uint32_t h1 = seed;
|
||||
|
||||
const uint32_t c1 = 0xcc9e2d51;
|
||||
const uint32_t c2 = 0x1b873593;
|
||||
|
||||
const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4);
|
||||
|
||||
for (int i = -nblocks; i; i++) {
|
||||
uint32_t k1 = blocks[i];
|
||||
|
||||
k1 *= c1;
|
||||
k1 = hash_rotl32(k1, 15);
|
||||
k1 *= c2;
|
||||
|
||||
h1 ^= k1;
|
||||
h1 = hash_rotl32(h1, 13);
|
||||
h1 = h1 * 5 + 0xe6546b64;
|
||||
}
|
||||
|
||||
const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
|
||||
|
||||
uint32_t k1 = 0;
|
||||
|
||||
switch (length & 3) {
|
||||
case 3:
|
||||
k1 ^= tail[2] << 16;
|
||||
[[fallthrough]];
|
||||
case 2:
|
||||
k1 ^= tail[1] << 8;
|
||||
[[fallthrough]];
|
||||
case 1:
|
||||
k1 ^= tail[0];
|
||||
k1 *= c1;
|
||||
k1 = hash_rotl32(k1, 15);
|
||||
k1 *= c2;
|
||||
h1 ^= k1;
|
||||
};
|
||||
|
||||
// Finalize with additional bit mixing.
|
||||
h1 ^= length;
|
||||
return hash_fmix32(h1);
|
||||
}
|
||||
|
||||
uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return ((p_prev << 5) + p_prev) + hash_one_uint64(u.i);
|
||||
}
|
||||
|
||||
uint64_t hash_djb2_one_float_64(double p_in, uint64_t p_prev) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return ((p_prev << 5) + p_prev) + u.i;
|
||||
}
|
|
@ -50,7 +50,7 @@ struct Pair;
|
|||
* @param C String
|
||||
* @return 32-bits hashcode
|
||||
*/
|
||||
static _FORCE_INLINE_ uint32_t hash_djb2(const char *p_cstr) {
|
||||
_FORCE_INLINE_ uint32_t hash_djb2(const char *p_cstr) {
|
||||
const unsigned char *chr = (const unsigned char *)p_cstr;
|
||||
uint32_t hash = 5381;
|
||||
uint32_t c = *chr++;
|
||||
|
@ -63,7 +63,7 @@ static _FORCE_INLINE_ uint32_t hash_djb2(const char *p_cstr) {
|
|||
return hash;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len, uint32_t p_prev = 5381) {
|
||||
_FORCE_INLINE_ uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len, uint32_t p_prev = 5381) {
|
||||
uint32_t hash = p_prev;
|
||||
|
||||
for (int i = 0; i < p_len; i++) {
|
||||
|
@ -73,7 +73,7 @@ static _FORCE_INLINE_ uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len
|
|||
return hash;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_djb2_one_32(uint32_t p_in, uint32_t p_prev = 5381) {
|
||||
_FORCE_INLINE_ uint32_t hash_djb2_one_32(uint32_t p_in, uint32_t p_prev = 5381) {
|
||||
return ((p_prev << 5) + p_prev) ^ p_in;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ static _FORCE_INLINE_ uint32_t hash_djb2_one_32(uint32_t p_in, uint32_t p_prev =
|
|||
* @param p_int - 64-bit unsigned integer key to be hashed
|
||||
* @return unsigned 32-bit value representing hashcode
|
||||
*/
|
||||
static _FORCE_INLINE_ uint32_t hash_one_uint64(const uint64_t p_int) {
|
||||
_FORCE_INLINE_ uint32_t hash_one_uint64(const uint64_t p_int) {
|
||||
uint64_t v = p_int;
|
||||
v = (~v) + (v << 18); // v = (v << 18) - v - 1;
|
||||
v = v ^ (v >> 31);
|
||||
|
@ -95,7 +95,7 @@ static _FORCE_INLINE_ uint32_t hash_one_uint64(const uint64_t p_int) {
|
|||
return uint32_t(v);
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint64_t hash64_murmur3_64(uint64_t key, uint64_t seed) {
|
||||
_FORCE_INLINE_ uint64_t hash64_murmur3_64(uint64_t key, uint64_t seed) {
|
||||
key ^= seed;
|
||||
key ^= key >> 33;
|
||||
key *= 0xff51afd7ed558ccd;
|
||||
|
@ -109,7 +109,7 @@ static _FORCE_INLINE_ uint64_t hash64_murmur3_64(uint64_t key, uint64_t seed) {
|
|||
// Murmurhash3 32-bit version.
|
||||
// All MurmurHash versions are public domain software, and the author disclaims all copyright to their code.
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_one_32(uint32_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
_FORCE_INLINE_ uint32_t hash_murmur3_one_32(uint32_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
p_in *= 0xcc9e2d51;
|
||||
p_in = (p_in << 15) | (p_in >> 17);
|
||||
p_in *= 0x1b873593;
|
||||
|
@ -121,48 +121,15 @@ static _FORCE_INLINE_ uint32_t hash_murmur3_one_32(uint32_t p_in, uint32_t p_see
|
|||
return p_seed;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_one_float(float p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.f = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.f = Math::NaN;
|
||||
} else {
|
||||
u.f = p_in;
|
||||
}
|
||||
|
||||
return hash_murmur3_one_32(u.i, p_seed);
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_one_64(uint64_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
_FORCE_INLINE_ uint32_t hash_murmur3_one_64(uint64_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
p_seed = hash_murmur3_one_32(p_in & 0xFFFFFFFF, p_seed);
|
||||
return hash_murmur3_one_32(p_in >> 32, p_seed);
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_one_double(double p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
uint32_t hash_murmur3_one_float(float p_in, uint32_t p_seed = HASH_MURMUR3_SEED);
|
||||
uint32_t hash_murmur3_one_double(double p_in, uint32_t p_seed = HASH_MURMUR3_SEED);
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return hash_murmur3_one_64(u.i, p_seed);
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_one_real(real_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
_FORCE_INLINE_ uint32_t hash_murmur3_one_real(real_t p_in, uint32_t p_seed = HASH_MURMUR3_SEED) {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
return hash_murmur3_one_double(p_in, p_seed);
|
||||
#else
|
||||
|
@ -170,11 +137,11 @@ static _FORCE_INLINE_ uint32_t hash_murmur3_one_real(real_t p_in, uint32_t p_see
|
|||
#endif
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_rotl32(uint32_t x, int8_t r) {
|
||||
_FORCE_INLINE_ uint32_t hash_rotl32(uint32_t x, int8_t r) {
|
||||
return (x << r) | (x >> (32 - r));
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_fmix32(uint32_t h) {
|
||||
_FORCE_INLINE_ uint32_t hash_fmix32(uint32_t h) {
|
||||
h ^= h >> 16;
|
||||
h *= 0x85ebca6b;
|
||||
h ^= h >> 13;
|
||||
|
@ -184,117 +151,15 @@ static _FORCE_INLINE_ uint32_t hash_fmix32(uint32_t h) {
|
|||
return h;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_murmur3_buffer(const void *key, int length, const uint32_t seed = HASH_MURMUR3_SEED) {
|
||||
// Although not required, this is a random prime number.
|
||||
const uint8_t *data = (const uint8_t *)key;
|
||||
const int nblocks = length / 4;
|
||||
uint32_t hash_murmur3_buffer(const void *key, int length, uint32_t seed = HASH_MURMUR3_SEED);
|
||||
|
||||
uint32_t h1 = seed;
|
||||
uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev = 5381);
|
||||
uint64_t hash_djb2_one_float_64(double p_in, uint64_t p_prev = 5381);
|
||||
|
||||
const uint32_t c1 = 0xcc9e2d51;
|
||||
const uint32_t c2 = 0x1b873593;
|
||||
|
||||
const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4);
|
||||
|
||||
for (int i = -nblocks; i; i++) {
|
||||
uint32_t k1 = blocks[i];
|
||||
|
||||
k1 *= c1;
|
||||
k1 = hash_rotl32(k1, 15);
|
||||
k1 *= c2;
|
||||
|
||||
h1 ^= k1;
|
||||
h1 = hash_rotl32(h1, 13);
|
||||
h1 = h1 * 5 + 0xe6546b64;
|
||||
}
|
||||
|
||||
const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
|
||||
|
||||
uint32_t k1 = 0;
|
||||
|
||||
switch (length & 3) {
|
||||
case 3:
|
||||
k1 ^= tail[2] << 16;
|
||||
[[fallthrough]];
|
||||
case 2:
|
||||
k1 ^= tail[1] << 8;
|
||||
[[fallthrough]];
|
||||
case 1:
|
||||
k1 ^= tail[0];
|
||||
k1 *= c1;
|
||||
k1 = hash_rotl32(k1, 15);
|
||||
k1 *= c2;
|
||||
h1 ^= k1;
|
||||
};
|
||||
|
||||
// Finalize with additional bit mixing.
|
||||
h1 ^= length;
|
||||
return hash_fmix32(h1);
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev = 5381) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return ((p_prev << 5) + p_prev) + hash_one_uint64(u.i);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static _FORCE_INLINE_ uint32_t hash_make_uint32_t(T p_in) {
|
||||
union {
|
||||
T t;
|
||||
uint32_t _u32;
|
||||
} _u;
|
||||
_u._u32 = 0;
|
||||
_u.t = p_in;
|
||||
return _u._u32;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint64_t hash_djb2_one_float_64(double p_in, uint64_t p_prev = 5381) {
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
|
||||
// Normalize +/- 0.0 and NaN values so they hash the same.
|
||||
if (p_in == 0.0f) {
|
||||
u.d = 0.0;
|
||||
} else if (Math::is_nan(p_in)) {
|
||||
u.d = Math::NaN;
|
||||
} else {
|
||||
u.d = p_in;
|
||||
}
|
||||
|
||||
return ((p_prev << 5) + p_prev) + u.i;
|
||||
}
|
||||
|
||||
static _FORCE_INLINE_ uint64_t hash_djb2_one_64(uint64_t p_in, uint64_t p_prev = 5381) {
|
||||
_FORCE_INLINE_ uint64_t hash_djb2_one_64(uint64_t p_in, uint64_t p_prev = 5381) {
|
||||
return ((p_prev << 5) + p_prev) ^ p_in;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static _FORCE_INLINE_ uint64_t hash_make_uint64_t(T p_in) {
|
||||
union {
|
||||
T t;
|
||||
uint64_t _u64;
|
||||
} _u;
|
||||
_u._u64 = 0; // in case p_in is smaller
|
||||
|
||||
_u.t = p_in;
|
||||
return _u._u64;
|
||||
}
|
||||
|
||||
template <typename, typename = std::void_t<>>
|
||||
struct has_hash_method : std::false_type {};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "array.h"
|
||||
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Dictionary);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Object);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, String);
|
||||
|
||||
#include "container_type_validate.h"
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include "dictionary.h"
|
||||
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Array);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Object);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, String);
|
||||
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/safe_refcount.h"
|
||||
|
|
|
@ -2941,7 +2941,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const {
|
|||
return hash_one_uint64(reinterpret_cast<const ::RID *>(_data._mem)->get_id());
|
||||
} break;
|
||||
case OBJECT: {
|
||||
return hash_one_uint64(hash_make_uint64_t(_get_obj().obj));
|
||||
return hash_one_uint64(reinterpret_cast<uint64_t>(_get_obj().obj));
|
||||
} break;
|
||||
case STRING_NAME: {
|
||||
return reinterpret_cast<const StringName *>(_data._mem)->hash();
|
||||
|
|
|
@ -2770,9 +2770,9 @@
|
|||
[b]Note:[/b] This property is only read when the project starts. There is currently no way to change this setting at run-time.
|
||||
</member>
|
||||
<member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false">
|
||||
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible. If [member rendering/viewport/hdr_2d] is [code]false[/code], 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. If [member rendering/viewport/hdr_2d] is [code]true[/code], debanding will affect all 2D and 3D rendering, including canvas items.
|
||||
If [code]true[/code], uses a fast dithering filter just before transforming floating point color values to integer color values to make banding significantly less visible. Debanding is applied at different steps of the rendering process depending on the rendering method and [member rendering/viewport/hdr_2d] setting.
|
||||
In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
|
||||
[b]Note:[/b] This property is only read when the project starts. To set debanding at runtime, set [member Viewport.use_debanding] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_use_debanding].
|
||||
[b]Note:[/b] This property is only read when the project starts and configures [method RenderingServer.material_set_use_debanding] and [member Viewport.use_debanding] of the root [Viewport]. When [member rendering/viewport/hdr_2d] is disabled, you should additionally set the [member Viewport.use_debanding] of other viewports in your project. To set debanding at run-time, the property that should be set depends on the renderer: Forward+ only uses [member Viewport.use_debanding] and Mobile uses both [method RenderingServer.material_set_use_debanding] and [member Viewport.use_debanding].
|
||||
</member>
|
||||
<member name="rendering/anti_aliasing/quality/use_taa" type="bool" setter="" getter="" default="false">
|
||||
Enables temporal antialiasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. Enabling TAA can make the image blurrier, which is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]).
|
||||
|
|
|
@ -2360,6 +2360,15 @@
|
|||
Sets a shader material's shader.
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_set_use_debanding">
|
||||
<return type="void" />
|
||||
<param index="0" name="enable" type="bool" />
|
||||
<description>
|
||||
When using the Mobile renderer, [method material_set_use_debanding] can be used to enable or disable the debanding feature of 3D materials ([BaseMaterial3D] and [ShaderMaterial]).
|
||||
[method material_set_use_debanding] has no effect when using the Compatibility or Forward+ renderer. In Forward+, [Viewport] debanding can be used instead.
|
||||
See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] and [method RenderingServer.viewport_set_use_debanding].
|
||||
</description>
|
||||
</method>
|
||||
<method name="mesh_add_surface">
|
||||
<return type="void" />
|
||||
<param index="0" name="mesh" type="RID" />
|
||||
|
|
|
@ -457,9 +457,9 @@
|
|||
[b]Note:[/b] Due to technical limitations, certain rendering features are disabled when a viewport has a transparent background. This currently applies to screen-space reflections, subsurface scattering, and depth of field.
|
||||
</member>
|
||||
<member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false">
|
||||
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible. If [member use_hdr_2d] is [code]false[/code], 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. If [member use_hdr_2d] is [code]true[/code], debanding will only be applied if this is the root [Viewport] and will affect all 2D and 3D rendering, including canvas items.
|
||||
In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
|
||||
See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] and [method RenderingServer.viewport_set_use_debanding].
|
||||
When using the Mobile or Forward+ renderers, set [member use_debanding] to enable or disable the debanding feature of this [Viewport]. If [member use_hdr_2d] is [code]false[/code], 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. If [member use_hdr_2d] is [code]true[/code], debanding will only be applied if this is the root [Viewport] and will affect all 2D and 3D rendering, including canvas items.
|
||||
[member use_debanding] has no effect when using the Compatibility rendering method. The Mobile renderer can also use material debanding, which can be set with [method RenderingServer.material_set_use_debanding] or configured with [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding].
|
||||
See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding], [method RenderingServer.material_set_use_debanding], and [method RenderingServer.viewport_set_use_debanding].
|
||||
</member>
|
||||
<member name="use_hdr_2d" type="bool" setter="set_use_hdr_2d" getter="is_using_hdr_2d" default="false">
|
||||
If [code]true[/code], 2D rendering will use a high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ or Compatibility renderer, this will be an [code]RGBA16[/code] framebuffer. When using the Mobile renderer, it will be an [code]RGB10_A2[/code] framebuffer.
|
||||
|
|
|
@ -4288,6 +4288,10 @@ void RasterizerSceneGLES3::lightmaps_set_bicubic_filter(bool p_enable) {
|
|||
lightmap_bicubic_upscale = p_enable;
|
||||
}
|
||||
|
||||
void RasterizerSceneGLES3::material_set_use_debanding(bool p_enable) {
|
||||
// Material debanding not yet implemented.
|
||||
}
|
||||
|
||||
RasterizerSceneGLES3::RasterizerSceneGLES3() {
|
||||
singleton = this;
|
||||
|
||||
|
|
|
@ -950,6 +950,7 @@ public:
|
|||
void decals_set_filter(RS::DecalFilter p_filter) override;
|
||||
void light_projectors_set_filter(RS::LightProjectorFilter p_filter) override;
|
||||
virtual void lightmaps_set_bicubic_filter(bool p_enable) override;
|
||||
virtual void material_set_use_debanding(bool p_enable) override;
|
||||
|
||||
RasterizerSceneGLES3();
|
||||
~RasterizerSceneGLES3();
|
||||
|
|
|
@ -382,7 +382,18 @@ static Variant get_documentation_default_value(const StringName &p_class_name, c
|
|||
if (ClassDB::can_instantiate(p_class_name) && !ClassDB::is_virtual(p_class_name)) { // Keep this condition in sync with ClassDB::class_get_default_property_value.
|
||||
default_value = ClassDB::class_get_default_property_value(p_class_name, p_property_name, &r_default_value_valid);
|
||||
} else {
|
||||
// Cannot get default value of classes that can't be instantiated
|
||||
// Cannot get default value of classes that can't be instantiated.
|
||||
|
||||
// Let's see if the abstract class has an explicitly set default.
|
||||
const HashMap<StringName, Variant> *default_properties = ClassDB::default_values.getptr(p_class_name);
|
||||
if (default_properties) {
|
||||
const Variant *property = default_properties->getptr(p_property_name);
|
||||
if (property) {
|
||||
r_default_value_valid = true;
|
||||
return *property;
|
||||
}
|
||||
}
|
||||
|
||||
List<StringName> inheriting_classes;
|
||||
ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
|
||||
for (const StringName &class_name : inheriting_classes) {
|
||||
|
|
|
@ -527,6 +527,7 @@ void EditorNode::_update_from_settings() {
|
|||
RS::get_singleton()->decals_set_filter(RS::DecalFilter(int(GLOBAL_GET("rendering/textures/decals/filter"))));
|
||||
RS::get_singleton()->light_projectors_set_filter(RS::LightProjectorFilter(int(GLOBAL_GET("rendering/textures/light_projectors/filter"))));
|
||||
RS::get_singleton()->lightmaps_set_bicubic_filter(GLOBAL_GET("rendering/lightmapping/lightmap_gi/use_bicubic_filter"));
|
||||
RS::get_singleton()->material_set_use_debanding(GLOBAL_GET("rendering/anti_aliasing/quality/use_debanding"));
|
||||
|
||||
SceneTree *tree = get_tree();
|
||||
tree->set_debug_collisions_color(GLOBAL_GET("debug/shapes/collision/shape_color"));
|
||||
|
|
|
@ -2117,8 +2117,8 @@ void ResourceImporterScene::get_internal_import_options(InternalImportCategory p
|
|||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "import/skip_import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "generate/physics", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "generate/navmesh", PROPERTY_HINT_ENUM, "Disabled,Mesh + NavMesh,NavMesh Only"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/body_type", PROPERTY_HINT_ENUM, "Static,Dynamic,Area"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/shape_type", PROPERTY_HINT_ENUM, "Decompose Convex,Simple Convex,Trimesh,Box,Sphere,Cylinder,Capsule,Automatic", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 7));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/body_type", PROPERTY_HINT_ENUM, "StaticBody3D,RigidBody3D,Area3D"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/shape_type", PROPERTY_HINT_ENUM, "Decompose Convex (Slow),Single Convex (Average),Trimesh (Slow),Box (Fast),Sphere (Fast),Cylinder (Average),Capsule (Fast),Automatic", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 7));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::OBJECT, "physics/physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), Variant()));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), 1));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "physics/mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), 1));
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
class Button;
|
||||
class ConfirmationDialog;
|
||||
|
|
|
@ -98,7 +98,6 @@ void PluginConfigDialog::_create_script_for_plugin(const String &p_plugin_path,
|
|||
scr->set_path(script_path, true);
|
||||
ResourceSaver::save(scr);
|
||||
p_config_file->save(p_plugin_path.path_join("plugin.cfg"));
|
||||
emit_signal(SNAME("plugin_ready"), scr.ptr(), active_edit->is_pressed() ? _to_absolute_plugin_path(_get_subfolder()) : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,15 +131,6 @@ void PluginConfigDialog::_on_required_text_changed() {
|
|||
if ((!script_edit->get_text().get_extension().is_empty() && script_edit->get_text().get_extension() != ext) || script_edit->get_text().ends_with(".")) {
|
||||
validation_panel->set_message(MSG_ID_SCRIPT, vformat(TTR("Script extension must match chosen language extension (.%s)."), ext), EditorValidationPanel::MSG_ERROR);
|
||||
}
|
||||
if (active_edit->is_visible()) {
|
||||
if (language->get_name() == "C#") {
|
||||
active_edit->set_pressed(false);
|
||||
active_edit->set_disabled(true);
|
||||
validation_panel->set_message(MSG_ID_ACTIVE, TTR("C# doesn't support activating the plugin on creation because the project must be built first."), EditorValidationPanel::MSG_WARNING);
|
||||
} else {
|
||||
active_edit->set_disabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String PluginConfigDialog::_get_subfolder() {
|
||||
|
@ -317,19 +307,6 @@ PluginConfigDialog::PluginConfigDialog() {
|
|||
script_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
grid->add_child(script_edit);
|
||||
|
||||
// Activate now checkbox
|
||||
Label *active_label = memnew(Label);
|
||||
active_label->set_text(TTR("Activate now?"));
|
||||
active_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
|
||||
grid->add_child(active_label);
|
||||
plugin_edit_hidden_controls.push_back(active_label);
|
||||
|
||||
active_edit = memnew(CheckBox);
|
||||
active_edit->set_pressed(true);
|
||||
active_edit->set_accessibility_name(TTRC("Activate now?"));
|
||||
grid->add_child(active_edit);
|
||||
plugin_edit_hidden_controls.push_back(active_edit);
|
||||
|
||||
Control *spacing = memnew(Control);
|
||||
vbox->add_child(spacing);
|
||||
spacing->set_custom_minimum_size(Size2(0, 10 * EDSCALE));
|
||||
|
|
|
@ -56,7 +56,6 @@ class PluginConfigDialog : public ConfirmationDialog {
|
|||
LineEdit *version_edit = nullptr;
|
||||
OptionButton *script_option_edit = nullptr;
|
||||
LineEdit *script_edit = nullptr;
|
||||
CheckBox *active_edit = nullptr;
|
||||
|
||||
LocalVector<Control *> plugin_edit_hidden_controls;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
void Path2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/panel.h"
|
||||
#include "scene/gui/view_panner.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "thirdparty/clipper2/include/clipper2/clipper.h"
|
||||
|
||||
#define PRECISION 1
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "scene/3d/camera_3d.h"
|
||||
#include "scene/3d/node_3d.h"
|
||||
#include "scene/3d/skeleton_3d.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
class Timer;
|
||||
class EditorNode3DGizmoPlugin;
|
||||
|
|
|
@ -124,7 +124,7 @@ void ScriptCreateDialog::_notification(int p_what) {
|
|||
} else {
|
||||
language_menu->select(default_language);
|
||||
}
|
||||
is_using_templates = EDITOR_DEF("_script_setup_use_script_templates", false);
|
||||
is_using_templates = EDITOR_GET("_script_setup_use_script_templates");
|
||||
use_templates->set_pressed(is_using_templates);
|
||||
} break;
|
||||
|
||||
|
@ -849,6 +849,7 @@ void ScriptCreateDialog::_bind_methods() {
|
|||
ScriptCreateDialog::ScriptCreateDialog() {
|
||||
if (EditorSettings::get_singleton()) {
|
||||
EDITOR_DEF("_script_setup_templates_dictionary", Dictionary());
|
||||
EDITOR_DEF("_script_setup_use_script_templates", true);
|
||||
}
|
||||
|
||||
/* Main Controls */
|
||||
|
|
|
@ -714,7 +714,12 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
style_tooltip->set_shadow_size(0);
|
||||
style_tooltip->set_content_margin_all(p_config.base_margin * EDSCALE * 0.5);
|
||||
style_tooltip->set_bg_color(p_config.dark_color_3 * Color(0.8, 0.8, 0.8, 0.9));
|
||||
style_tooltip->set_border_width_all(0);
|
||||
if (p_config.draw_extra_borders) {
|
||||
style_tooltip->set_border_width_all(Math::round(EDSCALE));
|
||||
style_tooltip->set_border_color(p_config.extra_border_color_2);
|
||||
} else {
|
||||
style_tooltip->set_border_width_all(0);
|
||||
}
|
||||
p_theme->set_stylebox(SceneStringName(panel), "TooltipPanel", style_tooltip);
|
||||
}
|
||||
|
||||
|
@ -2506,6 +2511,13 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
|
|||
Ref<StyleBoxFlat> style = p_config.tree_panel_style->duplicate();
|
||||
style->set_bg_color(p_config.dark_theme ? style->get_bg_color().lightened(0.04) : style->get_bg_color().darkened(0.04));
|
||||
style->set_border_color(p_config.dark_theme ? style->get_border_color().lightened(0.04) : style->get_border_color().darkened(0.04));
|
||||
if (p_config.draw_extra_borders) {
|
||||
// A tooltip border is already drawn for all tooltips when Draw Extra Borders is enabled.
|
||||
// Hide borders that don't serve in drawing a line between the title and content to prevent the border from being doubled.
|
||||
style->set_border_width(SIDE_TOP, 0);
|
||||
style->set_border_width(SIDE_LEFT, 0);
|
||||
style->set_border_width(SIDE_RIGHT, 0);
|
||||
}
|
||||
style->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
|
||||
style->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
|
||||
|
||||
|
@ -2516,6 +2528,13 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
|
|||
// EditorHelpBitContent.
|
||||
{
|
||||
Ref<StyleBoxFlat> style = p_config.tree_panel_style->duplicate();
|
||||
if (p_config.draw_extra_borders) {
|
||||
// A tooltip border is already drawn for all tooltips when Draw Extra Borders is enabled.
|
||||
// Hide borders that don't serve in drawing a line between the title and content to prevent the border from being doubled.
|
||||
style->set_border_width(SIDE_BOTTOM, 0);
|
||||
style->set_border_width(SIDE_LEFT, 0);
|
||||
style->set_border_width(SIDE_RIGHT, 0);
|
||||
}
|
||||
style->set_corner_radius(CORNER_TOP_LEFT, 0);
|
||||
style->set_corner_radius(CORNER_TOP_RIGHT, 0);
|
||||
|
||||
|
|
|
@ -65,6 +65,12 @@ void LocalizationEditor::_notification(int p_what) {
|
|||
_update_pot_file_extensions();
|
||||
pot_generate_dialog->add_filter("*.pot");
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_DRAG_END: {
|
||||
for (Tree *tree : trees) {
|
||||
tree->set_drop_mode_flags(Tree::DROP_MODE_DISABLED);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -503,6 +509,89 @@ void LocalizationEditor::_filesystem_file_removed(const String &p_file) {
|
|||
}
|
||||
}
|
||||
|
||||
Variant LocalizationEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
||||
Tree *tree = Object::cast_to<Tree>(p_from);
|
||||
ERR_FAIL_COND_V(trees.find(tree) == -1, Variant());
|
||||
|
||||
if (tree->get_button_id_at_position(p_point) != -1) {
|
||||
return Variant();
|
||||
}
|
||||
|
||||
TreeItem *selected = tree->get_next_selected(nullptr);
|
||||
if (!selected) {
|
||||
return Variant();
|
||||
}
|
||||
tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN);
|
||||
|
||||
Label *preview = memnew(Label);
|
||||
preview->set_text(selected->get_text(0));
|
||||
set_drag_preview(preview);
|
||||
|
||||
Dictionary drag_data;
|
||||
drag_data["type"] = tree_data_types[tree];
|
||||
drag_data["item"] = selected;
|
||||
|
||||
return drag_data;
|
||||
}
|
||||
|
||||
bool LocalizationEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
Tree *tree = Object::cast_to<Tree>(p_from);
|
||||
ERR_FAIL_COND_V(trees.find(tree) == -1, false);
|
||||
|
||||
Dictionary drop_data = p_data;
|
||||
return drop_data.get("type", "") == tree_data_types[tree];
|
||||
}
|
||||
|
||||
void LocalizationEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
Tree *tree = Object::cast_to<Tree>(p_from);
|
||||
ERR_FAIL_COND(trees.find(tree) == -1);
|
||||
|
||||
if (!can_drop_data_fw(p_point, p_data, p_from)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeItem *item = tree->get_item_at_position(p_point);
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
int section = MAX(tree->get_drop_section_at_position(p_point), 0);
|
||||
Dictionary drop_data = p_data;
|
||||
|
||||
TreeItem *from = Object::cast_to<TreeItem>(drop_data["item"]);
|
||||
if (item == from) {
|
||||
return;
|
||||
}
|
||||
|
||||
const StringName &setting = tree_settings[tree];
|
||||
PackedStringArray setting_value = GLOBAL_GET(setting);
|
||||
const PackedStringArray original_setting_value = setting_value;
|
||||
const int index_from = from->get_metadata(0);
|
||||
const String path = setting_value[index_from];
|
||||
|
||||
int target_index = item->get_metadata(0);
|
||||
target_index = MAX(target_index + section, 0);
|
||||
if (target_index > index_from) {
|
||||
target_index -= 1; // Account for item being removed.
|
||||
}
|
||||
|
||||
if (target_index == index_from) {
|
||||
return;
|
||||
}
|
||||
|
||||
setting_value.remove_at(index_from);
|
||||
setting_value.insert(target_index, path);
|
||||
|
||||
EditorUndoRedoManager *ur_man = EditorUndoRedoManager::get_singleton();
|
||||
ur_man->create_action(TTR("Rearrange Localization Items"));
|
||||
ur_man->add_do_method(ProjectSettings::get_singleton(), "set", setting, setting_value);
|
||||
ur_man->add_do_method(ProjectSettings::get_singleton(), "save");
|
||||
ur_man->add_do_method(this, "update_translations");
|
||||
ur_man->add_undo_method(ProjectSettings::get_singleton(), "set", setting, original_setting_value);
|
||||
ur_man->add_undo_method(ProjectSettings::get_singleton(), "save");
|
||||
ur_man->add_undo_method(this, "update_translations");
|
||||
ur_man->commit_action();
|
||||
}
|
||||
|
||||
void LocalizationEditor::update_translations() {
|
||||
if (updating_translations) {
|
||||
return;
|
||||
|
@ -652,6 +741,9 @@ LocalizationEditor::LocalizationEditor() {
|
|||
translation_list = memnew(Tree);
|
||||
translation_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
tmc->add_child(translation_list);
|
||||
trees.push_back(translation_list);
|
||||
tree_data_types[translation_list] = "localization_editor_translation_item";
|
||||
tree_settings[translation_list] = "internationalization/locale/translations";
|
||||
|
||||
locale_select = memnew(EditorLocaleDialog);
|
||||
locale_select->connect("locale_selected", callable_mp(this, &LocalizationEditor::_translation_res_option_selected));
|
||||
|
@ -755,6 +847,9 @@ LocalizationEditor::LocalizationEditor() {
|
|||
translation_pot_list = memnew(Tree);
|
||||
translation_pot_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
tvb->add_child(translation_pot_list);
|
||||
trees.push_back(translation_pot_list);
|
||||
tree_data_types[translation_pot_list] = "localization_editor_pot_item";
|
||||
tree_settings[translation_pot_list] = "internationalization/locale/translations_pot_files";
|
||||
|
||||
translation_pot_add_builtin = memnew(CheckBox(TTRC("Add Built-in Strings to POT")));
|
||||
translation_pot_add_builtin->set_tooltip_text(TTRC("Add strings from built-in components such as certain Control nodes."));
|
||||
|
@ -772,4 +867,8 @@ LocalizationEditor::LocalizationEditor() {
|
|||
pot_file_open_dialog->connect("files_selected", callable_mp(this, &LocalizationEditor::_pot_add));
|
||||
add_child(pot_file_open_dialog);
|
||||
}
|
||||
|
||||
for (Tree *tree : trees) {
|
||||
SET_DRAG_FORWARDING_GCD(tree, LocalizationEditor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,10 @@ class LocalizationEditor : public VBoxContainer {
|
|||
bool updating_translations = false;
|
||||
String localization_changed;
|
||||
|
||||
LocalVector<Tree *> trees;
|
||||
HashMap<Tree *, String> tree_data_types;
|
||||
HashMap<Tree *, StringName> tree_settings;
|
||||
|
||||
void _translation_file_open();
|
||||
void _translation_add(const PackedStringArray &p_paths);
|
||||
void _translation_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);
|
||||
|
@ -86,6 +90,10 @@ class LocalizationEditor : public VBoxContainer {
|
|||
void _filesystem_files_moved(const String &p_old_file, const String &p_new_file);
|
||||
void _filesystem_file_removed(const String &p_file);
|
||||
|
||||
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
|
||||
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
|
||||
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{6CE9A984-37B1-4F8A-8FE9-609F05F071B3}</ProjectGuid>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<PropertyGroup>
|
||||
<ProjectGuid>{B06C2951-C8E3-4F28-80B2-717CF327EB19}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<PropertyGroup>
|
||||
<ProjectGuid>{EAFFF236-FA96-4A4D-BD23-0E51EF988277}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<SelfContained>False</SelfContained>
|
||||
<RollForward>LatestMajor</RollForward>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "multiplayer_spawner.h"
|
||||
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "scene/main/multiplayer_api.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
|
|
@ -55,17 +55,15 @@
|
|||
#import <mach-o/getsect.h>
|
||||
|
||||
static uint64_t load_address() {
|
||||
const struct segment_command_64 *cmd = getsegbyname("__TEXT");
|
||||
char full_path[1024];
|
||||
uint32_t size = sizeof(full_path);
|
||||
|
||||
if (cmd && !_NSGetExecutablePath(full_path, &size)) {
|
||||
uint32_t dyld_count = _dyld_image_count();
|
||||
for (uint32_t i = 0; i < dyld_count; i++) {
|
||||
const char *image_name = _dyld_get_image_name(i);
|
||||
if (image_name && strncmp(image_name, full_path, 1024) == 0) {
|
||||
return cmd->vmaddr + _dyld_get_image_vmaddr_slide(i);
|
||||
}
|
||||
if (!_NSGetExecutablePath(full_path, &size)) {
|
||||
void *handle = dlopen(full_path, RTLD_LAZY | RTLD_NOLOAD);
|
||||
void *addr = dlsym(handle, "main");
|
||||
Dl_info info;
|
||||
if (dladdr(addr, &info)) {
|
||||
return (uint64_t)info.dli_fbase;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +98,7 @@ static void handle_crash(int sig) {
|
|||
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_CRASH);
|
||||
}
|
||||
|
||||
// Dump the backtrace to stderr with a message to the user
|
||||
// Dump the backtrace to stderr with a message to the user.
|
||||
print_error("\n================================================================");
|
||||
print_error(vformat("%s: Program crashed with signal %d", __FUNCTION__, sig));
|
||||
|
||||
|
@ -111,69 +109,88 @@ static void handle_crash(int sig) {
|
|||
print_error(vformat("Engine version: %s (%s)", GODOT_VERSION_FULL_NAME, GODOT_VERSION_HASH));
|
||||
}
|
||||
print_error(vformat("Dumping the backtrace. %s", msg));
|
||||
char **strings = backtrace_symbols(bt_buffer, size);
|
||||
if (strings) {
|
||||
void *load_addr = (void *)load_address();
|
||||
|
||||
for (size_t i = 1; i < size; i++) {
|
||||
char fname[1024];
|
||||
Dl_info info;
|
||||
List<String> args;
|
||||
args.push_back("-o");
|
||||
args.push_back(_execpath);
|
||||
|
||||
snprintf(fname, 1024, "%s", strings[i]);
|
||||
|
||||
// Try to demangle the function name to provide a more readable one
|
||||
if (dladdr(bt_buffer[i], &info) && info.dli_sname) {
|
||||
if (info.dli_sname[0] == '_') {
|
||||
int status;
|
||||
char *demangled = abi::__cxa_demangle(info.dli_sname, nullptr, 0, &status);
|
||||
|
||||
if (status == 0 && demangled) {
|
||||
snprintf(fname, 1024, "%s", demangled);
|
||||
}
|
||||
|
||||
if (demangled) {
|
||||
free(demangled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String output = fname;
|
||||
|
||||
// Try to get the file/line number using atos
|
||||
if (bt_buffer[i] > (void *)0x0 && OS::get_singleton()) {
|
||||
List<String> args;
|
||||
char str[1024];
|
||||
|
||||
args.push_back("-o");
|
||||
args.push_back(_execpath);
|
||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__)
|
||||
args.push_back("-arch");
|
||||
args.push_back("x86_64");
|
||||
args.push_back("-arch");
|
||||
args.push_back("x86_64");
|
||||
#elif defined(__aarch64__)
|
||||
args.push_back("-arch");
|
||||
args.push_back("arm64");
|
||||
args.push_back("-arch");
|
||||
args.push_back("arm64");
|
||||
#endif
|
||||
args.push_back("--fullPath");
|
||||
args.push_back("-l");
|
||||
snprintf(str, 1024, "%p", load_addr);
|
||||
args.push_back(str);
|
||||
snprintf(str, 1024, "%p", bt_buffer[i]);
|
||||
args.push_back(str);
|
||||
|
||||
int ret;
|
||||
String out = "";
|
||||
Error err = OS::get_singleton()->execute(String("atos"), args, &out, &ret);
|
||||
if (err == OK && out.substr(0, 2) != "0x") {
|
||||
out = out.substr(0, out.length() - 1);
|
||||
output = out;
|
||||
args.push_back("--fullPath");
|
||||
args.push_back("-l");
|
||||
|
||||
char str[1024];
|
||||
void *load_addr = (void *)load_address();
|
||||
snprintf(str, 1024, "%p", load_addr);
|
||||
args.push_back(str);
|
||||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
snprintf(str, 1024, "%p", bt_buffer[i]);
|
||||
args.push_back(str);
|
||||
}
|
||||
|
||||
// Single execution of atos with all addresses.
|
||||
String out;
|
||||
int ret;
|
||||
Error err = OS::get_singleton()->execute(String("atos"), args, &out, &ret);
|
||||
|
||||
if (err == OK) {
|
||||
// Parse the multi-line output
|
||||
Vector<String> lines = out.split("\n");
|
||||
|
||||
// Get demangled names from dladdr for fallback.
|
||||
char **strings = backtrace_symbols(bt_buffer, size);
|
||||
|
||||
for (int i = 1; i < lines.size() && i < (int)size; i++) {
|
||||
String output = lines[i];
|
||||
|
||||
// If atos failed for this address, fall back to dladdr.
|
||||
if (output.substr(0, 2) == "0x" && strings) {
|
||||
char fname[1024];
|
||||
Dl_info info;
|
||||
|
||||
snprintf(fname, 1024, "%s", strings[i]);
|
||||
|
||||
if (dladdr(bt_buffer[i], &info) && info.dli_sname) {
|
||||
if (info.dli_sname[0] == '_') {
|
||||
int status;
|
||||
char *demangled = abi::__cxa_demangle(info.dli_sname, nullptr, 0, &status);
|
||||
|
||||
if (status == 0 && demangled) {
|
||||
snprintf(fname, 1024, "%s", demangled);
|
||||
}
|
||||
|
||||
if (demangled) {
|
||||
free(demangled);
|
||||
}
|
||||
}
|
||||
}
|
||||
output = fname;
|
||||
}
|
||||
|
||||
print_error(vformat("[%d] %s", (int64_t)i, output));
|
||||
}
|
||||
|
||||
free(strings);
|
||||
if (strings) {
|
||||
free(strings);
|
||||
}
|
||||
} else {
|
||||
// Fallback if atos fails entirely
|
||||
char **strings = backtrace_symbols(bt_buffer, size);
|
||||
if (strings) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
print_error(vformat("[%d] %s", (int64_t)i, strings[i]));
|
||||
}
|
||||
free(strings);
|
||||
}
|
||||
}
|
||||
|
||||
print_error("-- END OF C++ BACKTRACE --");
|
||||
print_error("================================================================");
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/math/geometry_2d.h"
|
||||
#include "scene/main/timer.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "editor/themes/editor_scale.h"
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/curve_texture.h"
|
||||
#include "scene/resources/gradient_texture.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "scene/resources/particle_process_material.h"
|
||||
|
||||
AABB CPUParticles3D::get_aabb() const {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "scene/3d/cpu_particles_3d.h"
|
||||
#include "scene/resources/curve_texture.h"
|
||||
#include "scene/resources/gradient_texture.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "scene/resources/particle_process_material.h"
|
||||
|
||||
AABB GPUParticles3D::get_aabb() const {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "label_3d.h"
|
||||
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "scene/resources/theme.h"
|
||||
#include "scene/theme/theme_db.h"
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/templates/local_vector.h"
|
||||
#include "scene/3d/visual_instance_3d.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
#ifndef NAVIGATION_3D_DISABLED
|
||||
class NavigationMesh;
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "servers/navigation_3d/navigation_path_query_result_3d.h"
|
||||
|
||||
class Node3D;
|
||||
class StandardMaterial3D;
|
||||
|
||||
class NavigationAgent3D : public Node {
|
||||
GDCLASS(NavigationAgent3D, Node);
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "path_3d.h"
|
||||
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
Path3D::Path3D() {
|
||||
SceneTree *st = SceneTree::get_singleton();
|
||||
if (st && st->is_debugging_paths_hint()) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "collision_object_3d.h"
|
||||
|
||||
#include "scene/resources/3d/shape_3d.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
void CollisionObject3D::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "scene/3d/camera_3d.h"
|
||||
#include "scene/3d/node_3d.h"
|
||||
#include "scene/resources/3d/shape_3d.h"
|
||||
|
||||
class CollisionObject3D : public Node3D {
|
||||
GDCLASS(CollisionObject3D, Node3D);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "ray_cast_3d.h"
|
||||
|
||||
#include "scene/3d/physics/collision_object_3d.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
void RayCast3D::set_target_position(const Vector3 &p_point) {
|
||||
target_position = p_point;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "scene/3d/physics/collision_object_3d.h"
|
||||
#include "scene/resources/3d/concave_polygon_shape_3d.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
void ShapeCast3D::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "scene/3d/node_3d.h"
|
||||
#include "scene/resources/3d/shape_3d.h"
|
||||
|
||||
class SpringArm3D : public Node3D {
|
||||
GDCLASS(SpringArm3D, Node3D);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "sprite_3d.h"
|
||||
|
||||
#include "scene/resources/atlas_texture.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
Color SpriteBase3D::_get_color_accum() {
|
||||
if (!color_dirty) {
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include "scene/3d/node_3d.h"
|
||||
|
||||
class TriangleMesh;
|
||||
|
||||
class VisualInstance3D : public Node3D {
|
||||
GDCLASS(VisualInstance3D, Node3D);
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "scene/animation/animation_tree.h"
|
||||
#include "scene/resources/curve.h"
|
||||
|
||||
class AnimationNodeAnimation : public AnimationRootNode {
|
||||
GDCLASS(AnimationNodeAnimation, AnimationRootNode);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/math/expression.h"
|
||||
#include "scene/animation/animation_tree.h"
|
||||
#include "scene/resources/curve.h"
|
||||
|
||||
class AnimationNodeStateMachineTransition : public Resource {
|
||||
GDCLASS(AnimationNodeStateMachineTransition, Resource);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/popup.h"
|
||||
#include "scene/resources/shader.h"
|
||||
|
||||
class AspectRatioContainer;
|
||||
class ColorMode;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "color_picker_shape.h"
|
||||
|
||||
#include "scene/gui/margin_container.h"
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
void ColorPickerShape::_emit_color_changed() {
|
||||
color_picker->emit_signal(SNAME("color_changed"), color_picker->color);
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "scene/gui/scroll_bar.h"
|
||||
#include "scene/gui/spin_box.h"
|
||||
#include "scene/gui/view_panner.h"
|
||||
#include "scene/resources/material.h"
|
||||
#include "scene/resources/style_box_flat.h"
|
||||
#include "scene/theme/theme_db.h"
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/graph_frame.h"
|
||||
#include "scene/gui/graph_node.h"
|
||||
#include "scene/resources/shader.h"
|
||||
|
||||
class Button;
|
||||
class GraphEdit;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "rich_text_label.compat.inc"
|
||||
|
||||
#include "core/input/input_map.h"
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "core/math/math_defs.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "core/os/os.h"
|
||||
|
|
|
@ -1496,6 +1496,9 @@ void CanvasItem::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_parent_material"), "set_use_parent_material", "get_use_parent_material");
|
||||
// ADD_PROPERTY(PropertyInfo(Variant::BOOL,"transform/notify"),"set_transform_notify","is_transform_notify_enabled");
|
||||
|
||||
// Supply property explicitly; workaround for GH-111431 docs issue.
|
||||
ADD_PROPERTY_DEFAULT("physics_interpolation_mode", PhysicsInterpolationMode::PHYSICS_INTERPOLATION_MODE_INHERIT);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("draw"));
|
||||
ADD_SIGNAL(MethodInfo("visibility_changed"));
|
||||
ADD_SIGNAL(MethodInfo("hidden"));
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
#include "node.h"
|
||||
#include "node.compat.inc"
|
||||
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Mesh);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer);
|
||||
STATIC_ASSERT_INCOMPLETE_TYPE(class, Shader);
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "core/object/message_queue.h"
|
||||
|
|
|
@ -2086,7 +2086,7 @@ SceneTree::SceneTree() {
|
|||
const bool use_taa = GLOBAL_DEF_BASIC("rendering/anti_aliasing/quality/use_taa", false);
|
||||
root->set_use_taa(use_taa);
|
||||
|
||||
const bool use_debanding = GLOBAL_DEF("rendering/anti_aliasing/quality/use_debanding", false);
|
||||
const bool use_debanding = GLOBAL_GET("rendering/anti_aliasing/quality/use_debanding");
|
||||
root->set_use_debanding(use_debanding);
|
||||
|
||||
const bool use_occlusion_culling = GLOBAL_DEF("rendering/occlusion_culling/use_occlusion_culling", false);
|
||||
|
|
|
@ -35,10 +35,11 @@
|
|||
#include "core/templates/paged_allocator.h"
|
||||
#include "core/templates/self_list.h"
|
||||
#include "scene/main/scene_tree_fti.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
||||
#undef Window
|
||||
|
||||
class ArrayMesh;
|
||||
class PackedScene;
|
||||
class Node;
|
||||
#ifndef _3D_DISABLED
|
||||
|
|
|
@ -286,7 +286,7 @@ void SceneTreeFTI::_create_depth_lists() {
|
|||
|
||||
// This shouldn't happen, but wouldn't be terrible if it did.
|
||||
DEV_ASSERT(depth >= 0);
|
||||
depth = MIN(depth, (int32_t)data.scene_tree_depth_limit);
|
||||
depth = MIN(depth, (int32_t)data.scene_tree_depth_limit - 1);
|
||||
|
||||
LocalVector<Node3D *> &dest_list = data.dirty_node_depth_lists[depth];
|
||||
#ifdef GODOT_SCENE_TREE_FTI_EXTRA_CHECKS
|
||||
|
|
|
@ -77,7 +77,7 @@ class SceneTreeFTI {
|
|||
};
|
||||
|
||||
struct Data {
|
||||
static const uint32_t scene_tree_depth_limit = 32;
|
||||
static const uint32_t scene_tree_depth_limit = 48;
|
||||
|
||||
// Prev / Curr lists of Node3Ds having local xforms pumped.
|
||||
LocalVector<Node3D *> tick_xform_list[2];
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "shader_globals_override.h"
|
||||
|
||||
#include "scene/main/node.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
StringName *ShaderGlobalsOverride::_remap(const StringName &p_name) const {
|
||||
StringName *r = param_remaps.getptr(p_name);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "property_utils.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/templates/local_vector.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
|
|
@ -414,6 +414,14 @@ void register_scene_types() {
|
|||
GDREGISTER_VIRTUAL_CLASS(MissingNode);
|
||||
GDREGISTER_ABSTRACT_CLASS(InstancePlaceholder);
|
||||
|
||||
GDREGISTER_ABSTRACT_CLASS(CanvasItem);
|
||||
|
||||
GDREGISTER_VIRTUAL_CLASS(Texture);
|
||||
GDREGISTER_VIRTUAL_CLASS(Texture2D);
|
||||
|
||||
GDREGISTER_VIRTUAL_CLASS(Material);
|
||||
GDREGISTER_CLASS(PlaceholderMaterial);
|
||||
|
||||
GDREGISTER_ABSTRACT_CLASS(Viewport);
|
||||
GDREGISTER_CLASS(SubViewport);
|
||||
GDREGISTER_CLASS(ViewportTexture);
|
||||
|
@ -428,7 +436,6 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(HTTPRequest);
|
||||
GDREGISTER_CLASS(Timer);
|
||||
GDREGISTER_CLASS(CanvasLayer);
|
||||
GDREGISTER_CLASS(CanvasModulate);
|
||||
GDREGISTER_CLASS(ResourcePreloader);
|
||||
GDREGISTER_CLASS(Window);
|
||||
|
||||
|
@ -436,14 +443,13 @@ void register_scene_types() {
|
|||
|
||||
/* REGISTER GUI */
|
||||
|
||||
GDREGISTER_CLASS(ButtonGroup);
|
||||
GDREGISTER_VIRTUAL_CLASS(BaseButton);
|
||||
|
||||
OS::get_singleton()->yield(); // may take time to init
|
||||
|
||||
GDREGISTER_CLASS(Control);
|
||||
GDREGISTER_VIRTUAL_CLASS(BaseButton);
|
||||
GDREGISTER_CLASS(Button);
|
||||
GDREGISTER_CLASS(Label);
|
||||
GDREGISTER_VIRTUAL_CLASS(Range);
|
||||
GDREGISTER_ABSTRACT_CLASS(ScrollBar);
|
||||
GDREGISTER_CLASS(HScrollBar);
|
||||
GDREGISTER_CLASS(VScrollBar);
|
||||
|
@ -457,10 +463,11 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(CheckButton);
|
||||
GDREGISTER_CLASS(LinkButton);
|
||||
GDREGISTER_CLASS(Panel);
|
||||
GDREGISTER_VIRTUAL_CLASS(Range);
|
||||
GDREGISTER_CLASS(ButtonGroup);
|
||||
|
||||
OS::get_singleton()->yield(); // may take time to init
|
||||
|
||||
GDREGISTER_CLASS(Container);
|
||||
GDREGISTER_CLASS(TextureRect);
|
||||
GDREGISTER_CLASS(ColorRect);
|
||||
GDREGISTER_CLASS(NinePatchRect);
|
||||
|
@ -472,7 +479,6 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(HSeparator);
|
||||
GDREGISTER_CLASS(VSeparator);
|
||||
GDREGISTER_CLASS(TextureButton);
|
||||
GDREGISTER_CLASS(Container);
|
||||
GDREGISTER_CLASS(BoxContainer);
|
||||
GDREGISTER_CLASS(HBoxContainer);
|
||||
GDREGISTER_CLASS(VBoxContainer);
|
||||
|
@ -496,6 +502,9 @@ void register_scene_types() {
|
|||
GDREGISTER_VIRTUAL_CLASS(VideoStream);
|
||||
|
||||
#ifndef ADVANCED_GUI_DISABLED
|
||||
GDREGISTER_CLASS(AcceptDialog);
|
||||
GDREGISTER_CLASS(ConfirmationDialog);
|
||||
|
||||
GDREGISTER_CLASS(FileDialog);
|
||||
|
||||
GDREGISTER_CLASS(PopupMenu);
|
||||
|
@ -517,9 +526,6 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(RichTextEffect);
|
||||
GDREGISTER_CLASS(CharFXTransform);
|
||||
|
||||
GDREGISTER_CLASS(AcceptDialog);
|
||||
GDREGISTER_CLASS(ConfirmationDialog);
|
||||
|
||||
GDREGISTER_CLASS(SubViewportContainer);
|
||||
GDREGISTER_CLASS(SplitContainer);
|
||||
GDREGISTER_CLASS(HSplitContainer);
|
||||
|
@ -599,16 +605,6 @@ void register_scene_types() {
|
|||
GDREGISTER_VIRTUAL_CLASS(GeometryInstance3D);
|
||||
GDREGISTER_CLASS(Camera3D);
|
||||
GDREGISTER_CLASS(AudioListener3D);
|
||||
#ifndef XR_DISABLED
|
||||
GDREGISTER_CLASS(XRCamera3D);
|
||||
GDREGISTER_CLASS(XRNode3D);
|
||||
GDREGISTER_CLASS(XRController3D);
|
||||
GDREGISTER_CLASS(XRAnchor3D);
|
||||
GDREGISTER_CLASS(XROrigin3D);
|
||||
GDREGISTER_CLASS(XRBodyModifier3D);
|
||||
GDREGISTER_CLASS(XRHandModifier3D);
|
||||
GDREGISTER_CLASS(XRFaceModifier3D);
|
||||
#endif // XR_DISABLED
|
||||
GDREGISTER_CLASS(MeshInstance3D);
|
||||
GDREGISTER_CLASS(OccluderInstance3D);
|
||||
GDREGISTER_ABSTRACT_CLASS(Occluder3D);
|
||||
|
@ -645,9 +641,9 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(GPUParticlesAttractorVectorField3D);
|
||||
GDREGISTER_CLASS(CPUParticles3D);
|
||||
GDREGISTER_CLASS(Marker3D);
|
||||
GDREGISTER_CLASS(ModifierBoneTarget3D);
|
||||
GDREGISTER_CLASS(RootMotionView);
|
||||
GDREGISTER_VIRTUAL_CLASS(SkeletonModifier3D);
|
||||
GDREGISTER_CLASS(ModifierBoneTarget3D);
|
||||
GDREGISTER_CLASS(RetargetModifier3D);
|
||||
GDREGISTER_CLASS(SpringBoneSimulator3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(SpringBoneCollision3D);
|
||||
|
@ -659,6 +655,17 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(ConvertTransformModifier3D);
|
||||
GDREGISTER_CLASS(AimModifier3D);
|
||||
|
||||
#ifndef XR_DISABLED
|
||||
GDREGISTER_CLASS(XRCamera3D);
|
||||
GDREGISTER_CLASS(XRNode3D);
|
||||
GDREGISTER_CLASS(XRController3D);
|
||||
GDREGISTER_CLASS(XRAnchor3D);
|
||||
GDREGISTER_CLASS(XROrigin3D);
|
||||
GDREGISTER_CLASS(XRBodyModifier3D);
|
||||
GDREGISTER_CLASS(XRHandModifier3D);
|
||||
GDREGISTER_CLASS(XRFaceModifier3D);
|
||||
#endif // XR_DISABLED
|
||||
|
||||
OS::get_singleton()->yield(); // may take time to init
|
||||
|
||||
#ifndef PHYSICS_3D_DISABLED
|
||||
|
@ -844,10 +851,7 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(VisualShaderNodeParticleAccelerator);
|
||||
GDREGISTER_CLASS(VisualShaderNodeParticleEmit);
|
||||
|
||||
GDREGISTER_VIRTUAL_CLASS(Material);
|
||||
GDREGISTER_CLASS(PlaceholderMaterial);
|
||||
GDREGISTER_CLASS(ShaderMaterial);
|
||||
GDREGISTER_ABSTRACT_CLASS(CanvasItem);
|
||||
GDREGISTER_CLASS(CanvasTexture);
|
||||
GDREGISTER_CLASS(CanvasItemMaterial);
|
||||
SceneTree::add_idle_callback(CanvasItemMaterial::flush_changes);
|
||||
|
@ -891,6 +895,7 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(LightOccluder2D);
|
||||
GDREGISTER_CLASS(OccluderPolygon2D);
|
||||
GDREGISTER_CLASS(BackBufferCopy);
|
||||
GDREGISTER_CLASS(CanvasModulate);
|
||||
|
||||
OS::get_singleton()->yield(); // may take time to init
|
||||
|
||||
|
@ -1005,8 +1010,6 @@ void register_scene_types() {
|
|||
GDREGISTER_CLASS(CameraAttributesPhysical);
|
||||
GDREGISTER_CLASS(CameraAttributesPractical);
|
||||
GDREGISTER_CLASS(World2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(Texture);
|
||||
GDREGISTER_VIRTUAL_CLASS(Texture2D);
|
||||
GDREGISTER_CLASS(Sky);
|
||||
GDREGISTER_CLASS(CompressedTexture2D);
|
||||
GDREGISTER_CLASS(PortableCompressedTexture2D);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "visual_shader_particle_nodes.h"
|
||||
|
||||
#include "scene/resources/image_texture.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
||||
// VisualShaderNodeParticleEmitter
|
||||
|
||||
|
|
|
@ -273,7 +273,9 @@ void register_server_types() {
|
|||
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsServer2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsServer2DExtension);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState2DExtension);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState2DExtension);
|
||||
|
||||
GDREGISTER_NATIVE_STRUCT(PhysicsServer2DExtensionRayResult, "Vector2 position;Vector2 normal;RID rid;ObjectID collider_id;Object *collider;int shape");
|
||||
|
@ -281,8 +283,6 @@ void register_server_types() {
|
|||
GDREGISTER_NATIVE_STRUCT(PhysicsServer2DExtensionShapeRestInfo, "Vector2 point;Vector2 normal;RID rid;ObjectID collider_id;int shape;Vector2 linear_velocity");
|
||||
GDREGISTER_NATIVE_STRUCT(PhysicsServer2DExtensionMotionResult, "Vector2 travel;Vector2 remainder;Vector2 collision_point;Vector2 collision_normal;Vector2 collider_velocity;real_t collision_depth;real_t collision_safe_fraction;real_t collision_unsafe_fraction;int collision_local_shape;ObjectID collider_id;RID collider;int collider_shape");
|
||||
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState2D);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState2D);
|
||||
GDREGISTER_CLASS(PhysicsRayQueryParameters2D);
|
||||
GDREGISTER_CLASS(PhysicsPointQueryParameters2D);
|
||||
GDREGISTER_CLASS(PhysicsShapeQueryParameters2D);
|
||||
|
@ -307,7 +307,9 @@ void register_server_types() {
|
|||
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsServer3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DExtension);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState3DExtension);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3DExtension)
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DRenderingServerHandler)
|
||||
|
||||
|
@ -317,8 +319,6 @@ void register_server_types() {
|
|||
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionCollision, "Vector3 position;Vector3 normal;Vector3 collider_velocity;Vector3 collider_angular_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape");
|
||||
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionResult, "Vector3 travel;Vector3 remainder;real_t collision_depth;real_t collision_safe_fraction;real_t collision_unsafe_fraction;PhysicsServer3DExtensionMotionCollision collisions[32];int collision_count");
|
||||
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState3D);
|
||||
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState3D);
|
||||
GDREGISTER_CLASS(PhysicsRayQueryParameters3D);
|
||||
GDREGISTER_CLASS(PhysicsPointQueryParameters3D);
|
||||
GDREGISTER_CLASS(PhysicsShapeQueryParameters3D);
|
||||
|
@ -332,16 +332,16 @@ void register_server_types() {
|
|||
|
||||
#ifndef XR_DISABLED
|
||||
GDREGISTER_ABSTRACT_CLASS(XRInterface);
|
||||
GDREGISTER_ABSTRACT_CLASS(XRTracker);
|
||||
GDREGISTER_CLASS(XRVRS);
|
||||
GDREGISTER_CLASS(XRPositionalTracker);
|
||||
GDREGISTER_CLASS(XRBodyTracker);
|
||||
GDREGISTER_CLASS(XRControllerTracker);
|
||||
GDREGISTER_CLASS(XRFaceTracker);
|
||||
GDREGISTER_CLASS(XRHandTracker);
|
||||
GDREGISTER_CLASS(XRInterfaceExtension); // can't register this as virtual because we need a creation function for our extensions.
|
||||
GDREGISTER_CLASS(XRPose);
|
||||
GDREGISTER_CLASS(XRPositionalTracker);
|
||||
GDREGISTER_CLASS(XRServer);
|
||||
GDREGISTER_ABSTRACT_CLASS(XRTracker);
|
||||
#endif // XR_DISABLED
|
||||
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MovieWriterPNGWAV)) {
|
||||
|
|
|
@ -193,6 +193,7 @@ public:
|
|||
virtual void decals_set_filter(RS::DecalFilter p_filter) override {}
|
||||
virtual void light_projectors_set_filter(RS::LightProjectorFilter p_filter) override {}
|
||||
virtual void lightmaps_set_bicubic_filter(bool p_enable) override {}
|
||||
virtual void material_set_use_debanding(bool p_enable) override {}
|
||||
|
||||
RasterizerSceneDummy() {}
|
||||
~RasterizerSceneDummy() {}
|
||||
|
|
|
@ -3329,6 +3329,7 @@ void RenderForwardMobile::_update_shader_quality_settings() {
|
|||
light_projectors_get_filter() == RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC;
|
||||
|
||||
specialization.use_lightmap_bicubic_filter = lightmap_filter_bicubic_get();
|
||||
specialization.use_material_debanding = material_use_debanding_get();
|
||||
specialization.luminance_multiplier = 2.0f;
|
||||
scene_shader.set_default_specialization(specialization);
|
||||
|
||||
|
|
|
@ -89,21 +89,27 @@ public:
|
|||
uint32_t use_light_soft_shadows : 1;
|
||||
uint32_t use_directional_soft_shadows : 1;
|
||||
uint32_t decal_use_mipmaps : 1;
|
||||
|
||||
uint32_t projector_use_mipmaps : 1;
|
||||
uint32_t disable_fog : 1;
|
||||
uint32_t use_depth_fog : 1;
|
||||
uint32_t use_fog_aerial_perspective : 1;
|
||||
|
||||
uint32_t use_fog_sun_scatter : 1;
|
||||
uint32_t use_fog_height_density : 1;
|
||||
uint32_t use_lightmap_bicubic_filter : 1;
|
||||
uint32_t use_material_debanding : 1;
|
||||
|
||||
uint32_t multimesh : 1;
|
||||
uint32_t multimesh_format_2d : 1;
|
||||
uint32_t multimesh_has_color : 1;
|
||||
uint32_t multimesh_has_custom_data : 1;
|
||||
|
||||
uint32_t scene_use_ambient_cubemap : 1;
|
||||
uint32_t scene_use_reflection_cubemap : 1;
|
||||
uint32_t scene_roughness_limiter_enabled : 1;
|
||||
uint32_t padding_0 : 2;
|
||||
uint32_t padding_0 : 1;
|
||||
|
||||
uint32_t soft_shadow_samples : 6;
|
||||
uint32_t penumbra_shadow_samples : 6;
|
||||
};
|
||||
|
|
|
@ -1248,6 +1248,11 @@ void RendererSceneRenderRD::lightmaps_set_bicubic_filter(bool p_enable) {
|
|||
_update_shader_quality_settings();
|
||||
}
|
||||
|
||||
void RendererSceneRenderRD::material_set_use_debanding(bool p_enable) {
|
||||
material_use_debanding = p_enable;
|
||||
_update_shader_quality_settings();
|
||||
}
|
||||
|
||||
int RendererSceneRenderRD::get_roughness_layers() const {
|
||||
return sky.roughness_layers;
|
||||
}
|
||||
|
@ -1702,6 +1707,7 @@ void RendererSceneRenderRD::init() {
|
|||
decals_set_filter(RS::DecalFilter(int(GLOBAL_GET("rendering/textures/decals/filter"))));
|
||||
light_projectors_set_filter(RS::LightProjectorFilter(int(GLOBAL_GET("rendering/textures/light_projectors/filter"))));
|
||||
lightmaps_set_bicubic_filter(GLOBAL_GET("rendering/lightmapping/lightmap_gi/use_bicubic_filter"));
|
||||
material_set_use_debanding(GLOBAL_GET("rendering/anti_aliasing/quality/use_debanding"));
|
||||
|
||||
cull_argument.set_page_pool(&cull_argument_pool);
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ private:
|
|||
int soft_shadow_samples = 0;
|
||||
RS::DecalFilter decals_filter = RS::DECAL_FILTER_LINEAR_MIPMAPS;
|
||||
RS::LightProjectorFilter light_projectors_filter = RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS;
|
||||
bool material_use_debanding = false;
|
||||
|
||||
/* RENDER BUFFERS */
|
||||
|
||||
|
@ -278,6 +279,7 @@ public:
|
|||
virtual void decals_set_filter(RS::DecalFilter p_filter) override;
|
||||
virtual void light_projectors_set_filter(RS::LightProjectorFilter p_filter) override;
|
||||
virtual void lightmaps_set_bicubic_filter(bool p_enable) override;
|
||||
virtual void material_set_use_debanding(bool p_enable) override;
|
||||
|
||||
_FORCE_INLINE_ RS::ShadowQuality shadows_quality_get() const {
|
||||
return shadows_quality;
|
||||
|
@ -328,6 +330,10 @@ public:
|
|||
return decals_filter;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool material_use_debanding_get() const {
|
||||
return material_use_debanding;
|
||||
}
|
||||
|
||||
int get_roughness_layers() const;
|
||||
bool is_using_radiance_cubemap_array() const;
|
||||
|
||||
|
|
|
@ -2225,6 +2225,28 @@ void main() {
|
|||
|
||||
frag_color = out_color;
|
||||
|
||||
if (sc_use_material_debanding()) {
|
||||
// From https://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
|
||||
// and https://www.shadertoy.com/view/MslGR8 (5th one starting from the bottom)
|
||||
// NOTE: `gl_FragCoord` is in pixels (i.e. not normalized UV).
|
||||
// This dithering must be applied after encoding changes (linear/nonlinear) have been applied
|
||||
// as the final step before quantization from floating point to integer values.
|
||||
|
||||
// Iestyn's RGB dither (7 asm instructions) from Portal 2 X360, slightly modified for VR.
|
||||
// Removed the time component to avoid passing time into this shader.
|
||||
// This dither offset was chosen because it meshes nicely with the no-offset dither that
|
||||
// is used for Viewport debanding.
|
||||
const vec2 dither_offset = vec2(0.535, 8.715);
|
||||
vec3 dither = vec3(dot(vec2(171.0, 231.0), gl_FragCoord.xy + dither_offset));
|
||||
dither.rgb = fract(dither.rgb / vec3(103.0, 71.0, 97.0));
|
||||
|
||||
// Subtract 0.5 to avoid slightly brightening the whole viewport.
|
||||
// Use a dither strength of 100% rather than the 37.5% suggested by the original source.
|
||||
// Assume that this shader always writes to a 10-bit buffer, so divide by 1023 to align
|
||||
// to 10-bit quantization.
|
||||
frag_color.rgb += (dither.rgb - 0.5) / 1023.0;
|
||||
}
|
||||
|
||||
#endif //MODE_MULTIPLE_RENDER_TARGETS
|
||||
|
||||
#endif //MODE_RENDER_DEPTH
|
||||
|
|
|
@ -116,34 +116,38 @@ bool sc_use_lightmap_bicubic_filter() {
|
|||
return ((sc_packed_0() >> 10) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_multimesh() {
|
||||
bool sc_use_material_debanding() {
|
||||
return ((sc_packed_0() >> 11) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_multimesh_format_2d() {
|
||||
bool sc_multimesh() {
|
||||
return ((sc_packed_0() >> 12) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_multimesh_has_color() {
|
||||
bool sc_multimesh_format_2d() {
|
||||
return ((sc_packed_0() >> 13) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_multimesh_has_custom_data() {
|
||||
bool sc_multimesh_has_color() {
|
||||
return ((sc_packed_0() >> 14) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_scene_use_ambient_cubemap() {
|
||||
bool sc_multimesh_has_custom_data() {
|
||||
return ((sc_packed_0() >> 15) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_scene_use_reflection_cubemap() {
|
||||
bool sc_scene_use_ambient_cubemap() {
|
||||
return ((sc_packed_0() >> 16) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_scene_roughness_limiter_enabled() {
|
||||
bool sc_scene_use_reflection_cubemap() {
|
||||
return ((sc_packed_0() >> 17) & 1U) != 0;
|
||||
}
|
||||
|
||||
bool sc_scene_roughness_limiter_enabled() {
|
||||
return ((sc_packed_0() >> 18) & 1U) != 0;
|
||||
}
|
||||
|
||||
uint sc_soft_shadow_samples() {
|
||||
return (sc_packed_0() >> 20) & 63U;
|
||||
}
|
||||
|
|
|
@ -1390,6 +1390,7 @@ public:
|
|||
PASS1(decals_set_filter, RS::DecalFilter)
|
||||
PASS1(light_projectors_set_filter, RS::LightProjectorFilter)
|
||||
PASS1(lightmaps_set_bicubic_filter, bool)
|
||||
PASS1(material_set_use_debanding, bool)
|
||||
|
||||
virtual void update();
|
||||
|
||||
|
|
|
@ -342,6 +342,7 @@ public:
|
|||
virtual void decals_set_filter(RS::DecalFilter p_filter) = 0;
|
||||
virtual void light_projectors_set_filter(RS::LightProjectorFilter p_filter) = 0;
|
||||
virtual void lightmaps_set_bicubic_filter(bool p_enable) = 0;
|
||||
virtual void material_set_use_debanding(bool p_enable) = 0;
|
||||
|
||||
virtual void update() = 0;
|
||||
virtual ~RendererSceneRender() {}
|
||||
|
|
|
@ -355,6 +355,7 @@ public:
|
|||
virtual void decals_set_filter(RS::DecalFilter p_filter) = 0;
|
||||
virtual void light_projectors_set_filter(RS::LightProjectorFilter p_filter) = 0;
|
||||
virtual void lightmaps_set_bicubic_filter(bool p_enable) = 0;
|
||||
virtual void material_set_use_debanding(bool p_enable) = 0;
|
||||
|
||||
virtual bool free(RID p_rid) = 0;
|
||||
|
||||
|
|
|
@ -2341,6 +2341,8 @@ void RenderingServer::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("material_set_next_pass", "material", "next_material"), &RenderingServer::material_set_next_pass);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("material_set_use_debanding", "enable"), &RenderingServer::material_set_use_debanding);
|
||||
|
||||
BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MIN);
|
||||
BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MAX);
|
||||
|
||||
|
@ -3698,6 +3700,8 @@ void RenderingServer::init() {
|
|||
|
||||
GLOBAL_DEF_RST(PropertyInfo(Variant::FLOAT, "rendering/anti_aliasing/quality/smaa_edge_detection_threshold", PROPERTY_HINT_RANGE, "0.01,0.2,0.01"), 0.05);
|
||||
|
||||
GLOBAL_DEF("rendering/anti_aliasing/quality/use_debanding", false);
|
||||
|
||||
{
|
||||
String mode_hints;
|
||||
String mode_hints_metal;
|
||||
|
|
|
@ -271,6 +271,8 @@ public:
|
|||
|
||||
virtual void material_set_next_pass(RID p_material, RID p_next_material) = 0;
|
||||
|
||||
virtual void material_set_use_debanding(bool p_enable) = 0;
|
||||
|
||||
/* MESH API */
|
||||
|
||||
enum ArrayType {
|
||||
|
|
|
@ -853,6 +853,7 @@ public:
|
|||
FUNC1(decals_set_filter, RS::DecalFilter);
|
||||
FUNC1(light_projectors_set_filter, RS::LightProjectorFilter);
|
||||
FUNC1(lightmaps_set_bicubic_filter, bool);
|
||||
FUNC1(material_set_use_debanding, bool);
|
||||
|
||||
/* CAMERA ATTRIBUTES */
|
||||
|
||||
|
|
8
thirdparty/README.md
vendored
8
thirdparty/README.md
vendored
|
@ -74,7 +74,7 @@ Files extracted from upstream source:
|
|||
## basis_universal
|
||||
|
||||
- Upstream: https://github.com/BinomialLLC/basis_universal
|
||||
- Version: 1.60 (323239a6a5ffa57d6570cfc403be99156e33a8b0, 2025)
|
||||
- Version: git (b1110111d4a93c7dd7de93ce3d9ed8fcdfd114f2, 2025)
|
||||
- License: Apache 2.0
|
||||
|
||||
Files extracted from upstream source:
|
||||
|
@ -88,9 +88,9 @@ Patches:
|
|||
- `0001-external-zstd-pr344.patch` (GH-73441)
|
||||
- `0002-external-tinyexr.patch` (GH-97582)
|
||||
- `0003-remove-tinydds-qoi.patch` (GH-97582)
|
||||
- `0004-ambiguous-calls.patch` (GH-103968)
|
||||
- `0005-msvc-include-ctype.patch` (GH-106155)
|
||||
- `0006-clang-warning-exclude.patch` (GH-111346)
|
||||
- `0004-clang-warning-exclude.patch` (GH-111346)
|
||||
- `0005-unused-typedef.patch` (GH-111445)
|
||||
|
||||
|
||||
## brotli
|
||||
|
||||
|
|
2
thirdparty/basis_universal/LICENSE
vendored
2
thirdparty/basis_universal/LICENSE
vendored
|
@ -186,7 +186,7 @@
|
|||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2019-2025 Binomial LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -837,7 +837,7 @@ void decodeISETritBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
|||
deUint32 T7 = data.getNext(1);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#ifdef __GNUC__
|
||||
#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__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
@ -903,7 +903,7 @@ void decodeISEQuintBlock (ISEDecodedResult* dst, int numValues, BitAccessStream&
|
|||
deUint32 Q56 = data.getNext(2);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#ifdef __GNUC__
|
||||
#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__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -2376,7 +2376,7 @@ static void filter_block(uint32_t grid_x, uint32_t grid_y, const vec3F* pSrc_blo
|
|||
// filter columns
|
||||
if (grid_y == 6)
|
||||
{
|
||||
memcpy(pDst_block, temp_block, sizeof(vec3F) * 6 * 6);
|
||||
memcpy((void *)pDst_block, temp_block, sizeof(vec3F) * 6 * 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3360,6 +3360,7 @@ static bool pack_bc6h_image(const imagef &src_img, vector2D<basist::bc6h_block>
|
|||
|
||||
interval_timer tm;
|
||||
double total_enc_time = 0.0f;
|
||||
BASISU_NOTE_UNUSED(total_enc_time);
|
||||
|
||||
const uint32_t num_blocks_x = src_img.get_block_width(4);
|
||||
const uint32_t num_blocks_y = src_img.get_block_height(4);
|
||||
|
@ -4422,7 +4423,18 @@ static bool compress_strip_task(
|
|||
float min_corr = BIG_FLOAT_VAL, max_corr = -BIG_FLOAT_VAL;
|
||||
for (uint32_t i = 0; i < 3; i++)
|
||||
{
|
||||
if (half_comp_stats[i].m_range > 0.0f)
|
||||
#if 0
|
||||
// 9/5/2025, wrong metric, we're iterating channels pairs here, not individual channels.
|
||||
// On 3 active channel blocks this causes no difference.
|
||||
if (half_comp_stats[i].m_range > 0.0f)
|
||||
#else
|
||||
static const uint8_t s_chan_pairs[3][2] = { {0, 1}, {0, 2}, {1, 2} };
|
||||
|
||||
const uint32_t chanA = s_chan_pairs[i][0];
|
||||
const uint32_t chanB = s_chan_pairs[i][1];
|
||||
|
||||
if ((half_comp_stats[chanA].m_range > 0.0f) && (half_comp_stats[chanB].m_range > 0.0f))
|
||||
#endif
|
||||
{
|
||||
const float c = fabsf((float)half_cross_chan_stats[i].m_pearson);
|
||||
min_corr = minimum(min_corr, c);
|
||||
|
@ -4437,7 +4449,7 @@ static bool compress_strip_task(
|
|||
// TODO: Transform grayscale axis by covar matrix, compute variance vs. total variance
|
||||
const float MODE7_MIN_CHAN_CORR = .5f;
|
||||
const float MODE7_PCA_ANGLE_THRESH = .9f;
|
||||
use_single_subset_mode7 = is_grayscale || is_solid_block || (min_corr >= MODE7_MIN_CHAN_CORR);
|
||||
use_single_subset_mode7 = is_grayscale || is_solid_block || ((total_used_block_chans == 1) || (min_corr >= MODE7_MIN_CHAN_CORR));
|
||||
|
||||
if (use_single_subset_mode7)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace astc_6x6_hdr
|
|||
{
|
||||
// Important: The Delta ITP colorspace error metric we use internally makes several assumptions about the nature of the HDR RGB inputs supplied to the encoder.
|
||||
// This encoder computes colorspace error in the ICtCp (or more accurately the delta ITP, where CT is scaled by .5 vs. ICtCp to become T) colorspace, so getting this correct is important.
|
||||
// By default the encoder assumes the input is in absolute luminance (in nits or candela per square meter, cd/m²), specified as positive-only linear light RGB, using the REC 709 colorspace gamut (but NOT the sRGB transfer function, i.e. linear light).
|
||||
// By default the encoder assumes the input is in absolute luminance (in nits or candela per square meter, cd/m^2), specified as positive-only linear light RGB, using the REC 709 colorspace gamut (but NOT the sRGB transfer function, i.e. linear light).
|
||||
// If the m_rec2020_bt2100_color_gamut flag is true, the input colorspace is treated as REC 2020/BT.2100 (which is wider than 709).
|
||||
// For SDR/LDR->HDR upconversion, the REC 709 sRGB input should be converted to linear light (sRGB->linear) and the resulting normalized linear RGB values scaled by either 80 or 100 nits (the luminance of a typical SDR monitor).
|
||||
// SDR upconversion to normalized [0,1] (i.e. non-absolute) luminances may work but is not supported because ITP errors will not be predicted correctly.
|
||||
|
|
|
@ -3448,7 +3448,7 @@ namespace basisu
|
|||
}
|
||||
default:
|
||||
assert(0);
|
||||
fmt_debug_printf("HERE 1\n");
|
||||
//fmt_debug_printf("HERE 1\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3456,7 +3456,7 @@ namespace basisu
|
|||
{
|
||||
if ((m_params.m_ktx2_uastc_supercompression != basist::KTX2_SS_NONE) && (m_params.m_ktx2_uastc_supercompression != basist::KTX2_SS_ZSTANDARD))
|
||||
{
|
||||
fmt_debug_printf("HERE 2\n");
|
||||
//fmt_debug_printf("HERE 2\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3492,7 +3492,7 @@ namespace basisu
|
|||
}
|
||||
|
||||
basist::ktx2_header header;
|
||||
memset(&header, 0, sizeof(header));
|
||||
memset((void *)&header, 0, sizeof(header));
|
||||
|
||||
memcpy(header.m_identifier, basist::g_ktx2_file_identifier, sizeof(basist::g_ktx2_file_identifier));
|
||||
header.m_pixel_width = base_width;
|
||||
|
@ -3544,7 +3544,7 @@ namespace basisu
|
|||
}
|
||||
default:
|
||||
assert(0);
|
||||
fmt_debug_printf("HERE 3\n");
|
||||
//fmt_debug_printf("HERE 3\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3584,7 +3584,7 @@ namespace basisu
|
|||
|
||||
if (ZSTD_isError(result))
|
||||
{
|
||||
fmt_debug_printf("HERE 5\n");
|
||||
//fmt_debug_printf("HERE 5\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3593,7 +3593,7 @@ namespace basisu
|
|||
#else
|
||||
// Can't get here
|
||||
assert(0);
|
||||
fmt_debug_printf("HERE 6\n");
|
||||
//fmt_debug_printf("HERE 6\n");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
@ -3618,7 +3618,7 @@ namespace basisu
|
|||
etc1s_global_data_header.m_tables_byte_length = backend_output.m_slice_image_tables.size();
|
||||
|
||||
basisu::vector<basist::ktx2_etc1s_image_desc> etc1s_image_descs(total_levels * total_layers * total_faces);
|
||||
memset(etc1s_image_descs.data(), 0, etc1s_image_descs.size_in_bytes());
|
||||
memset((void *)etc1s_image_descs.data(), 0, etc1s_image_descs.size_in_bytes());
|
||||
|
||||
for (uint32_t slice_index = 0; slice_index < m_slice_descs.size(); slice_index++)
|
||||
{
|
||||
|
@ -3662,7 +3662,7 @@ namespace basisu
|
|||
else if (m_fmt_mode == basist::basis_tex_format::cASTC_HDR_6x6_INTERMEDIATE)
|
||||
{
|
||||
basisu::vector<basist::ktx2_astc_hdr_6x6_intermediate_image_desc> image_descs(total_levels * total_layers * total_faces);
|
||||
memset(image_descs.data(), 0, image_descs.size_in_bytes());
|
||||
memset((void *)image_descs.data(), 0, image_descs.size_in_bytes());
|
||||
|
||||
for (uint32_t slice_index = 0; slice_index < m_slice_descs.size(); slice_index++)
|
||||
{
|
||||
|
@ -3717,7 +3717,7 @@ namespace basisu
|
|||
uint8_vec dfd;
|
||||
if (!get_dfd(dfd, header))
|
||||
{
|
||||
fmt_debug_printf("HERE 7\n");
|
||||
//fmt_debug_printf("HERE 7\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3729,20 +3729,20 @@ namespace basisu
|
|||
{
|
||||
if (key_values[i].m_key.size() < 2)
|
||||
{
|
||||
fmt_debug_printf("HERE 8\n");
|
||||
//fmt_debug_printf("HERE 8\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key_values[i].m_key.back() != 0)
|
||||
{
|
||||
fmt_debug_printf("HERE 9\n");
|
||||
//fmt_debug_printf("HERE 9\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
const uint64_t total_len = (uint64_t)key_values[i].m_key.size() + (uint64_t)key_values[i].m_value.size();
|
||||
if (total_len >= UINT32_MAX)
|
||||
{
|
||||
fmt_debug_printf("HERE 10\n");
|
||||
//fmt_debug_printf("HERE 10\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3777,7 +3777,7 @@ namespace basisu
|
|||
assert(!pass);
|
||||
if (pass)
|
||||
{
|
||||
fmt_debug_printf("HERE 11\n");
|
||||
//fmt_debug_printf("HERE 11\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3805,7 +3805,7 @@ namespace basisu
|
|||
}
|
||||
|
||||
basisu::vector<basist::ktx2_level_index> level_index_array(total_levels);
|
||||
memset(level_index_array.data(), 0, level_index_array.size_in_bytes());
|
||||
memset((void *)level_index_array.data(), 0, level_index_array.size_in_bytes());
|
||||
|
||||
m_output_ktx2_file.clear();
|
||||
m_output_ktx2_file.reserve(m_output_basis_file.size());
|
||||
|
|
|
@ -651,7 +651,7 @@ namespace basisu
|
|||
}
|
||||
|
||||
img.resize(width, height);
|
||||
memcpy(img.get_ptr(), pMem, width * height * sizeof(float) * 4);
|
||||
memcpy((void *)img.get_ptr(), pMem, width * height * sizeof(float) * 4);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -2236,7 +2236,10 @@ namespace basisu
|
|||
debug_printf("job_pool::~job_pool\n");
|
||||
|
||||
// Notify all workers that they need to die right now.
|
||||
m_kill_flag.store(true);
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_mutex);
|
||||
m_kill_flag.store(true);
|
||||
}
|
||||
|
||||
m_has_work.notify_all();
|
||||
|
||||
|
@ -2326,17 +2329,27 @@ namespace basisu
|
|||
|
||||
m_num_active_workers.fetch_add(1);
|
||||
|
||||
while (true)
|
||||
while (!m_kill_flag)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
|
||||
// Wait for any jobs to be issued.
|
||||
#if 0
|
||||
m_has_work.wait(lock, [this] { return m_kill_flag || m_queue.size(); } );
|
||||
#else
|
||||
// For more safety vs. buggy RTL's. Worse case we stall for a second vs. locking up forever if something goes wrong.
|
||||
m_has_work.wait_for(lock, std::chrono::milliseconds(1000), [this] {
|
||||
return m_kill_flag || !m_queue.empty();
|
||||
});
|
||||
#endif
|
||||
|
||||
// Check to see if we're supposed to exit.
|
||||
if (m_kill_flag)
|
||||
break;
|
||||
|
||||
if (m_queue.empty())
|
||||
continue;
|
||||
|
||||
// Get the job and execute it.
|
||||
std::function<void()> job(m_queue.back());
|
||||
m_queue.pop_back();
|
||||
|
@ -3449,7 +3462,7 @@ namespace basisu
|
|||
}
|
||||
else
|
||||
{
|
||||
memcpy(img.get_ptr(), out_rgba, sizeof(float) * 4 * img.get_total_pixels());
|
||||
memcpy((void *)img.get_ptr(), out_rgba, static_cast<size_t>(sizeof(float) * 4 * img.get_total_pixels()));
|
||||
}
|
||||
|
||||
free(out_rgba);
|
||||
|
@ -3471,7 +3484,7 @@ namespace basisu
|
|||
}
|
||||
|
||||
img.resize(width, height);
|
||||
memcpy(img.get_ptr(), out_rgba, width * height * sizeof(float) * 4);
|
||||
memcpy((void *)img.get_ptr(), out_rgba, width * height * sizeof(float) * 4);
|
||||
free(out_rgba);
|
||||
|
||||
return true;
|
||||
|
|
10
thirdparty/basis_universal/encoder/basisu_enc.h
vendored
10
thirdparty/basis_universal/encoder/basisu_enc.h
vendored
|
@ -22,6 +22,7 @@
|
|||
#include <functional>
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
|
||||
#if !defined(_WIN32) || defined(__MINGW32__)
|
||||
|
@ -2163,17 +2164,24 @@ namespace basisu
|
|||
uint32_t max_threads, job_pool *pJob_pool,
|
||||
bool even_odd_input_pairs_equal)
|
||||
{
|
||||
// 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
|
||||
typedef std::map< typename Quantizer::training_vec_type, weighted_block_group > group_hash;
|
||||
#endif
|
||||
|
||||
//interval_timer tm;
|
||||
//tm.start();
|
||||
|
||||
group_hash unique_vecs;
|
||||
|
||||
// rg 6/24/2025 - Cross platform determinism
|
||||
#if 0
|
||||
unique_vecs.reserve(20000);
|
||||
#endif
|
||||
|
||||
weighted_block_group g;
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
#define BASISU_OPENCL_ASSERT_ON_ANY_ERRORS (1)
|
||||
#ifndef BASISU_OPENCL_ASSERT_ON_ANY_ERRORS
|
||||
#define BASISU_OPENCL_ASSERT_ON_ANY_ERRORS (0)
|
||||
#endif
|
||||
|
||||
namespace basisu
|
||||
{
|
||||
|
|
|
@ -231,18 +231,7 @@ namespace basisu
|
|||
|
||||
inline void set_to_black()
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#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__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#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
|
||||
|
|
2
thirdparty/basis_universal/encoder/jpgd.cpp
vendored
2
thirdparty/basis_universal/encoder/jpgd.cpp
vendored
|
@ -3146,7 +3146,7 @@ namespace jpgd {
|
|||
|
||||
for (int y = 0; y < image_height; y++)
|
||||
{
|
||||
const uint8* pScan_line;
|
||||
const uint8* pScan_line = nullptr;
|
||||
uint scan_line_len;
|
||||
if (decoder.decode((const void**)&pScan_line, &scan_line_len) != JPGD_SUCCESS)
|
||||
{
|
||||
|
|
|
@ -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
|
93
thirdparty/basis_universal/transcoder/basisu.h
vendored
93
thirdparty/basis_universal/transcoder/basisu.h
vendored
|
@ -107,20 +107,7 @@ namespace basisu
|
|||
debug_puts(res.c_str());
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template <typename T> inline void clear_obj(T& obj) { memset(&obj, 0, sizeof(obj)); }
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
template <typename T> inline void clear_obj(T& obj) { memset((void *)&obj, 0, sizeof(obj)); }
|
||||
|
||||
constexpr double cPiD = 3.14159265358979323846264338327950288;
|
||||
constexpr float REALLY_SMALL_FLOAT_VAL = .000000125f;
|
||||
|
@ -348,6 +335,7 @@ namespace basisu
|
|||
|
||||
inline packed_uint& operator= (uint64_t v)
|
||||
{
|
||||
// TODO: Add assert on truncation?
|
||||
for (uint32_t i = 0; i < NumBytes; i++)
|
||||
m_bytes[i] = static_cast<uint8_t>(v >> (i * 8));
|
||||
return *this;
|
||||
|
@ -358,69 +346,10 @@ namespace basisu
|
|||
memcpy(m_bytes, rhs.m_bytes, sizeof(m_bytes));
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
#endif
|
||||
inline operator uint32_t() const
|
||||
{
|
||||
switch (NumBytes)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
return m_bytes[0];
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
return (m_bytes[1] << 8U) | m_bytes[0];
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
return (m_bytes[2] << 16U) | (m_bytes[1] << 8U) | m_bytes[0];
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
return read_le_dword(m_bytes);
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
uint32_t l = read_le_dword(m_bytes);
|
||||
uint32_t h = m_bytes[4];
|
||||
return static_cast<uint64_t>(l) | (static_cast<uint64_t>(h) << 32U);
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
uint32_t l = read_le_dword(m_bytes);
|
||||
uint32_t h = (m_bytes[5] << 8U) | m_bytes[4];
|
||||
return static_cast<uint64_t>(l) | (static_cast<uint64_t>(h) << 32U);
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
uint32_t l = read_le_dword(m_bytes);
|
||||
uint32_t h = (m_bytes[6] << 16U) | (m_bytes[5] << 8U) | m_bytes[4];
|
||||
return static_cast<uint64_t>(l) | (static_cast<uint64_t>(h) << 32U);
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
uint32_t l = read_le_dword(m_bytes);
|
||||
uint32_t h = read_le_dword(m_bytes + 4);
|
||||
return static_cast<uint64_t>(l) | (static_cast<uint64_t>(h) << 32U);
|
||||
}
|
||||
default:
|
||||
{
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#else
|
||||
inline operator uint32_t() const
|
||||
|
||||
inline uint64_t get_uint64() const
|
||||
{
|
||||
// Some compilers may warn about this code. It clearly cannot access beyond the end of the m_bytes struct here.
|
||||
if constexpr (NumBytes == 1)
|
||||
{
|
||||
return m_bytes[0];
|
||||
|
@ -467,8 +396,18 @@ namespace basisu
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint32_t get_uint32() const
|
||||
{
|
||||
static_assert(NumBytes <= sizeof(uint32_t), "packed_uint too large to use get_uint32");
|
||||
return static_cast<uint32_t>(get_uint64());
|
||||
}
|
||||
|
||||
inline operator uint32_t() const
|
||||
{
|
||||
static_assert(NumBytes <= sizeof(uint32_t), "packed_uint too large to use operator uint32_t");
|
||||
return static_cast<uint32_t>(get_uint64());
|
||||
}
|
||||
};
|
||||
|
||||
enum eZero { cZero };
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// basisu_astc_helpers.h
|
||||
// Be sure to define ASTC_HELPERS_IMPLEMENTATION somewhere to get the implementation, otherwise you only get the header.
|
||||
#pragma once
|
||||
#ifndef BASISU_ASTC_HELPERS_HEADER
|
||||
#define BASISU_ASTC_HELPERS_HEADER
|
||||
|
||||
|
|
|
@ -1503,22 +1503,10 @@ namespace basisu
|
|||
|
||||
if (BASISU_IS_BITWISE_COPYABLE(T))
|
||||
{
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#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__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1649,19 +1637,8 @@ namespace basisu
|
|||
|
||||
if (BASISU_IS_BITWISE_COPYABLE(T))
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
#endif
|
||||
if ((m_p) && (other.m_p))
|
||||
memcpy(m_p, other.m_p, other.m_size * sizeof(T));
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
memcpy((void *)m_p, other.m_p, other.m_size * sizeof(T));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2233,21 +2210,7 @@ namespace basisu
|
|||
}
|
||||
|
||||
// Copy "down" the objects to preserve, filling in the empty slots.
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
memmove(pDst, pSrc, num_to_move * sizeof(T));
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
memmove((void *)pDst, pSrc, num_to_move * sizeof(T));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2492,18 +2455,13 @@ namespace basisu
|
|||
{
|
||||
if ((sizeof(T) == 1) && (scalar_type<T>::cFlag))
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#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__
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
#include "basisu_transcoder.h"
|
||||
#include "basisu_containers_impl.h"
|
||||
|
||||
#include "basisu_astc_hdr_core.h"
|
||||
|
||||
#define BASISU_ASTC_HELPERS_IMPLEMENTATION
|
||||
#include "basisu_astc_helpers.h"
|
||||
|
||||
#include "basisu_astc_hdr_core.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
@ -4622,6 +4622,7 @@ namespace basist
|
|||
const int CHROMA_THRESH = 10;
|
||||
|
||||
uint32_t total_filtered_blocks = 0;
|
||||
BASISU_NOTE_UNUSED(total_filtered_blocks);
|
||||
|
||||
for (int by = 0; by < (int)num_blocks_y; by++)
|
||||
{
|
||||
|
@ -9446,7 +9447,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t rgb_offset, uint32_t rgb_length, uint32_t alpha_offset, uint32_t alpha_length,
|
||||
uint64_t rgb_offset, uint32_t rgb_length, uint64_t alpha_offset, uint32_t alpha_length,
|
||||
uint32_t decode_flags,
|
||||
bool basis_file_has_alpha_slices,
|
||||
bool is_video,
|
||||
|
@ -10311,7 +10312,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags,
|
||||
bool has_alpha,
|
||||
bool is_video,
|
||||
|
@ -10802,7 +10803,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags,
|
||||
bool has_alpha,
|
||||
bool is_video,
|
||||
|
@ -11238,7 +11239,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags,
|
||||
bool has_alpha,
|
||||
bool is_video,
|
||||
|
@ -11685,7 +11686,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags,
|
||||
bool has_alpha,
|
||||
bool is_video,
|
||||
|
@ -18847,11 +18848,11 @@ namespace basist
|
|||
m_pData = nullptr;
|
||||
m_data_size = 0;
|
||||
|
||||
memset(&m_header, 0, sizeof(m_header));
|
||||
memset((void *)&m_header, 0, sizeof(m_header));
|
||||
m_levels.clear();
|
||||
m_dfd.clear();
|
||||
m_key_values.clear();
|
||||
memset(&m_etc1s_header, 0, sizeof(m_etc1s_header));
|
||||
memset((void *)&m_etc1s_header, 0, sizeof(m_etc1s_header));
|
||||
m_etc1s_image_descs.clear();
|
||||
m_astc_6x6_intermediate_image_descs.clear();
|
||||
|
||||
|
@ -18900,7 +18901,7 @@ namespace basist
|
|||
m_pData = static_cast<const uint8_t *>(pData);
|
||||
m_data_size = data_size;
|
||||
|
||||
memcpy(&m_header, pData, sizeof(m_header));
|
||||
memcpy((void *)&m_header, pData, sizeof(m_header));
|
||||
|
||||
// Check for supported VK formats. We may also need to parse the DFD.
|
||||
if ((m_header.m_vk_format != KTX2_VK_FORMAT_UNDEFINED) &&
|
||||
|
@ -18973,13 +18974,13 @@ namespace basist
|
|||
}
|
||||
#endif
|
||||
|
||||
if (m_header.m_sgd_byte_offset < sizeof(ktx2_header))
|
||||
if (m_header.m_sgd_byte_offset.get_uint64() < sizeof(ktx2_header))
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Supercompression global data offset is too low\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.m_sgd_byte_offset + m_header.m_sgd_byte_length > m_data_size)
|
||||
if (m_header.m_sgd_byte_offset.get_uint64() + m_header.m_sgd_byte_length.get_uint64() > m_data_size)
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Supercompression global data offset and/or length is too high\n");
|
||||
return false;
|
||||
|
@ -19000,23 +19001,23 @@ namespace basist
|
|||
return false;
|
||||
}
|
||||
|
||||
memcpy(&m_levels[0], m_pData + sizeof(ktx2_header), level_index_size_in_bytes);
|
||||
memcpy((void *)&m_levels[0], m_pData + sizeof(ktx2_header), level_index_size_in_bytes);
|
||||
|
||||
// Sanity check the level offsets and byte sizes
|
||||
for (uint32_t i = 0; i < m_levels.size(); i++)
|
||||
{
|
||||
if (m_levels[i].m_byte_offset < sizeof(ktx2_header))
|
||||
if (m_levels[i].m_byte_offset.get_uint64() < sizeof(ktx2_header))
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid level offset (too low)\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_levels[i].m_byte_length)
|
||||
if (!m_levels[i].m_byte_length.get_uint64())
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid level byte length\n");
|
||||
}
|
||||
|
||||
if ((m_levels[i].m_byte_offset + m_levels[i].m_byte_length) > m_data_size)
|
||||
if ((m_levels[i].m_byte_offset.get_uint64() + m_levels[i].m_byte_length.get_uint64()) > m_data_size)
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid level offset and/or length\n");
|
||||
return false;
|
||||
|
@ -19024,7 +19025,7 @@ namespace basist
|
|||
|
||||
const uint64_t MAX_SANE_LEVEL_UNCOMP_SIZE = 2048ULL * 1024ULL * 1024ULL;
|
||||
|
||||
if (m_levels[i].m_uncompressed_byte_length >= MAX_SANE_LEVEL_UNCOMP_SIZE)
|
||||
if (m_levels[i].m_uncompressed_byte_length.get_uint64() >= MAX_SANE_LEVEL_UNCOMP_SIZE)
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid level offset (too large)\n");
|
||||
return false;
|
||||
|
@ -19032,7 +19033,7 @@ namespace basist
|
|||
|
||||
if (m_header.m_supercompression_scheme == KTX2_SS_BASISLZ)
|
||||
{
|
||||
if (m_levels[i].m_uncompressed_byte_length)
|
||||
if (m_levels[i].m_uncompressed_byte_length.get_uint64())
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid uncompressed length (0)\n");
|
||||
return false;
|
||||
|
@ -19040,7 +19041,7 @@ namespace basist
|
|||
}
|
||||
else if (m_header.m_supercompression_scheme >= KTX2_SS_ZSTANDARD)
|
||||
{
|
||||
if (!m_levels[i].m_uncompressed_byte_length)
|
||||
if (!m_levels[i].m_uncompressed_byte_length.get_uint64())
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::init: Invalid uncompressed length (1)\n");
|
||||
return false;
|
||||
|
@ -19435,8 +19436,8 @@ namespace basist
|
|||
return false;
|
||||
}
|
||||
|
||||
const uint8_t* pComp_level_data = m_pData + m_levels[level_index].m_byte_offset;
|
||||
uint64_t comp_level_data_size = m_levels[level_index].m_byte_length;
|
||||
const uint8_t* pComp_level_data = m_pData + m_levels[level_index].m_byte_offset.get_uint64();
|
||||
uint64_t comp_level_data_size = m_levels[level_index].m_byte_length.get_uint64();
|
||||
|
||||
const uint8_t* pUncomp_level_data = pComp_level_data;
|
||||
uint64_t uncomp_level_data_size = comp_level_data_size;
|
||||
|
@ -19498,8 +19499,8 @@ namespace basist
|
|||
pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, m_pData, m_data_size,
|
||||
num_blocks4_x, num_blocks4_y, level_width, level_height,
|
||||
level_index,
|
||||
m_levels[level_index].m_byte_offset + image_desc.m_rgb_slice_byte_offset, image_desc.m_rgb_slice_byte_length,
|
||||
image_desc.m_alpha_slice_byte_length ? (m_levels[level_index].m_byte_offset + image_desc.m_alpha_slice_byte_offset) : 0, image_desc.m_alpha_slice_byte_length,
|
||||
m_levels[level_index].m_byte_offset.get_uint64() + image_desc.m_rgb_slice_byte_offset, image_desc.m_rgb_slice_byte_length,
|
||||
image_desc.m_alpha_slice_byte_length ? (m_levels[level_index].m_byte_offset.get_uint64() + image_desc.m_alpha_slice_byte_offset) : 0, image_desc.m_alpha_slice_byte_length,
|
||||
decode_flags, m_has_alpha,
|
||||
m_is_video, output_row_pitch_in_blocks_or_pixels, &pState->m_transcoder_state, output_rows_in_pixels))
|
||||
{
|
||||
|
@ -19536,7 +19537,7 @@ namespace basist
|
|||
if (!m_astc_hdr_6x6_intermediate_transcoder.transcode_image(fmt,
|
||||
pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels,
|
||||
m_pData, m_data_size, num_blocks6_x, num_blocks6_y, level_width, level_height, level_index,
|
||||
m_levels[level_index].m_byte_offset + image_desc.m_rgb_slice_byte_offset, image_desc.m_rgb_slice_byte_length,
|
||||
m_levels[level_index].m_byte_offset.get_uint64() + image_desc.m_rgb_slice_byte_offset, image_desc.m_rgb_slice_byte_length,
|
||||
decode_flags, m_has_alpha, m_is_video, output_row_pitch_in_blocks_or_pixels, nullptr, output_rows_in_pixels, channel0, channel1))
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::transcode_image_2D: ASTC 6x6 HDR transcode_image() failed, this is either a bug or the file is corrupted/invalid\n");
|
||||
|
@ -19549,7 +19550,7 @@ namespace basist
|
|||
const uint32_t num_blocks6_y = (level_height + 5) / 6;
|
||||
|
||||
// Compute length and offset to uncompressed 2D UASTC texture data, given the face/layer indices.
|
||||
assert(uncomp_level_data_size == m_levels[level_index].m_uncompressed_byte_length);
|
||||
assert(uncomp_level_data_size == m_levels[level_index].m_uncompressed_byte_length.get_uint64());
|
||||
const uint32_t total_2D_image_size = num_blocks6_x * num_blocks6_y * sizeof(astc_helpers::astc_block);
|
||||
|
||||
const uint32_t uncomp_ofs = (layer_index * m_header.m_face_count + face_index) * total_2D_image_size;
|
||||
|
@ -19581,7 +19582,7 @@ namespace basist
|
|||
(m_format == basist::basis_tex_format::cUASTC_HDR_4x4))
|
||||
{
|
||||
// Compute length and offset to uncompressed 2D UASTC texture data, given the face/layer indices.
|
||||
assert(uncomp_level_data_size == m_levels[level_index].m_uncompressed_byte_length);
|
||||
assert(uncomp_level_data_size == m_levels[level_index].m_uncompressed_byte_length.get_uint64());
|
||||
const uint32_t total_2D_image_size = num_blocks4_x * num_blocks4_y * KTX2_UASTC_BLOCK_SIZE;
|
||||
|
||||
const uint32_t uncomp_ofs = (layer_index * m_header.m_face_count + face_index) * total_2D_image_size;
|
||||
|
@ -19637,10 +19638,10 @@ namespace basist
|
|||
|
||||
bool ktx2_transcoder::decompress_level_data(uint32_t level_index, basisu::uint8_vec& uncomp_data)
|
||||
{
|
||||
const uint8_t* pComp_data = m_levels[level_index].m_byte_offset + m_pData;
|
||||
const uint64_t comp_size = m_levels[level_index].m_byte_length;
|
||||
const uint8_t* pComp_data = m_levels[level_index].m_byte_offset.get_uint64() + m_pData;
|
||||
const uint64_t comp_size = m_levels[level_index].m_byte_length.get_uint64();
|
||||
|
||||
const uint64_t uncomp_size = m_levels[level_index].m_uncompressed_byte_length;
|
||||
const uint64_t uncomp_size = m_levels[level_index].m_uncompressed_byte_length.get_uint64();
|
||||
|
||||
if (((size_t)comp_size) != comp_size)
|
||||
{
|
||||
|
@ -19687,9 +19688,9 @@ namespace basist
|
|||
const uint32_t image_count = basisu::maximum<uint32_t>(m_header.m_layer_count, 1) * m_header.m_face_count * m_header.m_level_count;
|
||||
assert(image_count);
|
||||
|
||||
const uint8_t* pSrc = m_pData + m_header.m_sgd_byte_offset;
|
||||
const uint8_t* pSrc = m_pData + m_header.m_sgd_byte_offset.get_uint64();
|
||||
|
||||
if (m_header.m_sgd_byte_length != image_count * sizeof(ktx2_astc_hdr_6x6_intermediate_image_desc))
|
||||
if (m_header.m_sgd_byte_length.get_uint64() != image_count * sizeof(ktx2_astc_hdr_6x6_intermediate_image_desc))
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::decompress_astc_6x6_hdr_intermediate_global_data: Invalid global data length\n");
|
||||
return false;
|
||||
|
@ -19697,7 +19698,7 @@ namespace basist
|
|||
|
||||
m_astc_6x6_intermediate_image_descs.resize(image_count);
|
||||
|
||||
memcpy(m_astc_6x6_intermediate_image_descs.data(), pSrc, sizeof(ktx2_astc_hdr_6x6_intermediate_image_desc) * image_count);
|
||||
memcpy((void *)m_astc_6x6_intermediate_image_descs.data(), pSrc, sizeof(ktx2_astc_hdr_6x6_intermediate_image_desc) * image_count);
|
||||
|
||||
// Sanity check the image descs
|
||||
for (uint32_t i = 0; i < image_count; i++)
|
||||
|
@ -19724,9 +19725,9 @@ namespace basist
|
|||
const uint32_t image_count = basisu::maximum<uint32_t>(m_header.m_layer_count, 1) * m_header.m_face_count * m_header.m_level_count;
|
||||
assert(image_count);
|
||||
|
||||
const uint8_t* pSrc = m_pData + m_header.m_sgd_byte_offset;
|
||||
const uint8_t* pSrc = m_pData + m_header.m_sgd_byte_offset.get_uint64();
|
||||
|
||||
memcpy(&m_etc1s_header, pSrc, sizeof(ktx2_etc1s_global_data_header));
|
||||
memcpy((void *)&m_etc1s_header, pSrc, sizeof(ktx2_etc1s_global_data_header));
|
||||
pSrc += sizeof(ktx2_etc1s_global_data_header);
|
||||
|
||||
if ((!m_etc1s_header.m_endpoints_byte_length) || (!m_etc1s_header.m_selectors_byte_length) || (!m_etc1s_header.m_tables_byte_length))
|
||||
|
@ -19747,7 +19748,7 @@ namespace basist
|
|||
m_etc1s_header.m_endpoints_byte_length +
|
||||
m_etc1s_header.m_selectors_byte_length +
|
||||
m_etc1s_header.m_tables_byte_length +
|
||||
m_etc1s_header.m_extended_byte_length) > m_header.m_sgd_byte_length)
|
||||
m_etc1s_header.m_extended_byte_length) > m_header.m_sgd_byte_length.get_uint64())
|
||||
{
|
||||
BASISU_DEVEL_ERROR("ktx2_transcoder::decompress_etc1s_global_data: SGD byte length is too small, file is invalid or corrupted\n");
|
||||
return false;
|
||||
|
@ -19759,7 +19760,7 @@ namespace basist
|
|||
return false;
|
||||
}
|
||||
|
||||
memcpy(m_etc1s_image_descs.data(), pSrc, sizeof(ktx2_etc1s_image_desc) * image_count);
|
||||
memcpy((void *)m_etc1s_image_descs.data(), pSrc, sizeof(ktx2_etc1s_image_desc) * image_count);
|
||||
pSrc += sizeof(ktx2_etc1s_image_desc) * image_count;
|
||||
|
||||
// Sanity check the ETC1S image descs
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t rgb_offset, uint32_t rgb_length, uint32_t alpha_offset, uint32_t alpha_length,
|
||||
uint64_t rgb_offset, uint32_t rgb_length, uint64_t alpha_offset, uint32_t alpha_length,
|
||||
uint32_t decode_flags = 0,
|
||||
bool basis_file_has_alpha_slices = false,
|
||||
bool is_video = false,
|
||||
|
@ -342,7 +342,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags = 0,
|
||||
bool has_alpha = false,
|
||||
bool is_video = false,
|
||||
|
@ -379,7 +379,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags = 0,
|
||||
bool has_alpha = false,
|
||||
bool is_video = false,
|
||||
|
@ -416,7 +416,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags = 0,
|
||||
bool has_alpha = false,
|
||||
bool is_video = false,
|
||||
|
@ -453,7 +453,7 @@ namespace basist
|
|||
void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
|
||||
const uint8_t* pCompressed_data, uint32_t compressed_data_length,
|
||||
uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
|
||||
uint32_t slice_offset, uint32_t slice_length,
|
||||
uint64_t slice_offset, uint32_t slice_length,
|
||||
uint32_t decode_flags = 0,
|
||||
bool has_alpha = false,
|
||||
bool is_video = false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue