You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Correct hash behavior for floating point numbers
This backports the work in #7815 and the subsequent fixes in #8393 The following program now works as expected in this branch in both release_debug and debug mode: ```gdscript print(sqrt(-1)) print(sqrt(-1)) var simple1=asin(10.0) var simple2=acos(10.0) print(simple1) print(simple2) ``` And successfully prints -nan 4 times This fixes #9580 and fixes #8925
This commit is contained in:
@@ -1217,7 +1217,7 @@ void BakedLightBaker::_make_octree_texture() {
|
||||
base <<= 16;
|
||||
base |= int((pos.z + cell_size * 0.5) / cell_size);
|
||||
|
||||
uint32_t hash = HashMapHahserDefault::hash(base);
|
||||
uint32_t hash = HashMapHasherDefault::hash(base);
|
||||
uint32_t idx = hash % hash_table_size;
|
||||
octhashptr[oct_idx].next = hashptr[idx];
|
||||
octhashptr[oct_idx].hash = hash;
|
||||
@@ -1243,7 +1243,7 @@ void BakedLightBaker::_make_octree_texture() {
|
||||
base <<= 16;
|
||||
base |= int((pos.z + cell_size * 0.5) / cell_size);
|
||||
|
||||
uint32_t hash = HashMapHahserDefault::hash(base);
|
||||
uint32_t hash = HashMapHasherDefault::hash(base);
|
||||
uint32_t idx = hash % hash_table_size;
|
||||
|
||||
uint32_t bucket = hashptr[idx];
|
||||
|
||||
Reference in New Issue
Block a user