rbray89 / ActiveTextureManagement

Compresses the Textures after loading in KSP
63 stars 10 forks source link

Basic threading for LibSquish. Launch 1 thread per line of block #10

Closed sarbian closed 9 years ago

sarbian commented 9 years ago

With a limit of 1 thread per CPU thread (8 for a 4 core i7)

Using ThreadPool does not make the best looking code but it works fine.

rbray89 commented 9 years ago

Looks good, what kind of performance buffs do you get?

sarbian commented 9 years ago

About x5 on my i7-2600k (so 8 thread)

rbray89 commented 9 years ago

WOW! Ok. I'll run some tests when I get home. If it runs as well as you say, then I think we have a winner, and lots more credit to sarbian!

rbray89 commented 9 years ago

Hmmm... did you run KSP after caching? I just tried this out and the textures look like they were filled with stack garbage... I'm wondering if the byte pointers don't transfer nicely between threads?

rbray89 commented 9 years ago

Ah, looks like there was a minor issue in the calculation for the storage pointer.

sarbian commented 9 years ago

oh, I launched it with some flag and they looked fine. Well, you found the bug anyway :)