bolrog / d2dx

D2DX is a complete solution to make Diablo II run well on modern PCs, with high fps and better resolutions.
GNU General Public License v3.0
426 stars 48 forks source link

Use xxhash for textures and palettes #190

Open Jarcho opened 1 year ago

Jarcho commented 1 year ago

fixes #140

Both the river of flame and various parts of act 5 need to hash over 1MB per frame. I've measured hashing adding about 20ms-50ms per frame which causes the frame rate to drop below 25fps at times. xxhash is more than 10x which is enough to remove get rid of the stalls.

Also fixes a potential collision issue with 32bit hashes. There are over 2000 hash collisions with fnv. Mods can add more on top of that.

CaptainRay1993 commented 1 year ago

This commit seems incompatible with Median XL. With self-compiled glide dll the game window looks as followed: Screenshot (103)

Jarcho commented 1 year ago

It was actually totally broken. Last change I made without testing caused all textures of the same size to get the same hash. Fixed now.