seedhartha / reone

Game engine capable of running KotOR and TSL
GNU General Public License v3.0
268 stars 24 forks source link

Fix rendering on intel mesa #17

Closed Ziemas closed 3 years ago

Ziemas commented 3 years ago

Rendering on Intel was broken because of multiple sampler types pointing to the same texture unit. So it seems like texture sampler uniforms always needs to be initialized.

With this change they always get set and always uses the same texture units for each type.

Idk if this is the best way to fix it, but it was quick and easy.

Also a fix for an invalid enum error with glTexParameteri.

seedhartha commented 3 years ago

Neat, thanks! I will check later today, how does setting sampler uniforms every frame affect performance. I feel uniforms really are becoming a bottleneck at this point.

seedhartha commented 3 years ago

Merged. It did cause a ~30% decrease in FPS, but I managed to offset it by setting sampler uniforms once at shader initialization.