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:
Hein-Pieter van Braam 2017-02-15 14:41:16 +01:00
parent 58508eef5b
commit 364f2e8082
11 changed files with 272 additions and 66 deletions

View file

@ -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];