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.
Objective
Address some issues afflicting the Adreno series of GPUs, specifically on WebGL.
Alpha blending is broken for these GPUs since the standard blending changes were merged.
Also there is an issue related to directional lights and fog.
Fixes #8506
Fixes #8047
Solution
The first issue in relation to alpha blending was a weird one. It could be fixed by moving the flags for the alpha blending from the end of the
u32
to just after the last flag from the beginning instead. This seems to be because of some differences in the memory mapping, probably at a lower level. However this fix should work for all other architectures as well.The second issue is also weird and potentially also related to some as of yet unknown issue with how data is passed between the CPU and the GPU. My best guess is that it is an issue with the Adreno shader compiler that messes up since
gpu_directional_lights
is an array of 10 by default and it either tries to do some fancy pre-optimization or fumbles when the data is copied over to the gpu here as well. The simplest solution I could think of that works without requiring major changes that would affect all platform is to add a feature that can be passed along if you for some reason need to have your code running specifically on these types of GPUS. Thus I added thelimit_directional_light
feature that limits the directional lights to 1 but by default it still stays at 10.Changelog
limit_directional_light
feature that limits the amount of directional lights to one because of issues with the Adreno chipset and fog.