Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #1294
Previously, when
r_lazyShaders 1
was used, it would simply load all of the possible shaders with the current graphics settings, and without deform shaders.With this change, it will instead mark shaders that are used for BSP and model surfaces for building, which will be done in
RE_EndRegistration()
. Skins are also loaded (the variants with skeletal animation are always loaded because we don't know if an MD5 model will need them later).This greatly reduces the amount of shaders built, and allows building deform shaders at map load. For example, on plat23 with pretty much all shader stuff enabled (except liquid shaders and static reflections), including material system, it went down from 433 shaders built at map load to just 28. I did know that a bunch of the shaders were unused, but this is still a surprising amount less.
Also made it so when a shader is loaded outside of
BuildAll()
(i. e. inBindProgram()
orGetProgram()
), the engine will print information about that.From my testing, there are only a few shaders that this system doesn't get at map load, I'll see if I can make those load at the start as well in a different pr.