CaffeineMC / sodium-fabric

A Minecraft mod designed to improve frame rates and reduce micro-stutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement caching at runtime for shader programs

jellysquid3 opened this issue · comments

The terrain shaders get recompiled every time the renderer is reloaded. This is often unnecessary and can make switching worlds (especially in multiplayer) slower than it needs to be.

We should only compile these shaders once, and keep them loaded until the game is shut down. There should also be a hotkey (probably only within a developer workspace) to reload these shaders.

Furthermore, if the shaders fail to compile, we should not crash the game (since this makes development _terrible.) Either a toast message needs to be shown that shaders failed to compile (if we have no cached shaders), or the last-good shaders need to be kept loaded.