Add "NO_SHADOWS" shader version to Mobile backend #82215
+58
−13
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.
Before this patch, if the dev disabled shadows on all lights Godot would avoid the shadow casting pass but it would still use a pixel shader that tried to sample an empty shadow map (i.e. it's always shadow = 1.0).
After this patch, we compile a variant that has samples no shadows.
The shader already had support for this (#define SHADOWS_DISABLED) but it was not being used for this purpose. It was only used if the material had specifically enabled a setting to not receive shadows.
This greatly improves performance on low end GPUs such as Adreno 505.
Note that low end mobile has multiple bottlenecks at the same time (we're everything-bound 🤣 ) and this is the first PR in a series of PRs to improve mobile performance.