gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
754 stars 174 forks source link

Improve Rand() in NoiseTexture.cpp #2757

Closed Rosalie241 closed 1 year ago

Rosalie241 commented 1 year ago

This patch is pulled from #2236 to improve the initializing noise texture speed, this patch makes it pretty much instant.

m4xw commented 1 year ago

Should be obsolete if i ever get to #2236 for all intents and purposes but lets see

Rosalie241 commented 1 year ago

After some discussion with m4xw on discord, I just pulled the code mentioned from the mentioned issue, which helps a lot, I also made both mudlord and m4xw commit author.

m4xw commented 1 year ago

Fwiw i still plan to someday do a nice class like i wanted before but if this gets merged we may close my Issue for the time being. Also just for the record, current logic was bugged as well as it created random data on the thread using MT but then only proceeds to use them as seeds and rely on cryptographically secure rng. To me seems implied that with the old implementation you would've wanted to pass the generator itself and then use it inside FillTextureData, but either way, this impl is a lot faster, essentially instant.

mudlord commented 1 year ago

Thanks for this @Rosalie241 I forgot I even did this.