Open donnierussellii opened 4 years ago
My idea is to use the pointer to the last byte of the bmp, keeping the hash at 64 bits.
Would this lock us into only supporting OpenGL on 64 bit machines? I'd like to avoid that issue if at all possible.
I think we could just use a 64-bit hash for all platforms (on 32-bit cpus, slower, though), but if it's a 32-bit pointer simply cast it to a 64-bit value, with the upper bits unused. Up to date compilers should support uint64_t or unsigned long long.
In my PR #264 I shifted the bmp width and height (16 bits each) onto the bmp ptr (32), making a 64-bit hash to prevent a bug with some textures having the same ptr but a different size. I was getting garbage pixels on invisible mutants.
This fix was only a stopgap until we moved to 64 bits. So, can we use a 96-bit hash here? or is there something better?