Fix GLES sampler precision issue for advanced pipeline #5466
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.
Currently we do not add precision description to sampler2D's, and the default precision defined by ESSL spec is lowp.
Experimentation on an Imagination AXM-8-256 GPU shows that the advanced pipeline needs highp sampler2D, otherwise some distant objects will glitch (noticable at the start point of black_forest map).
Manually add precision modifiers for sampler2D to fix the glitch.
Tested on Eswin EIC7700 with X11+EGL+GLES with Imagination DDK 23.2 driver.
P.S. setting mediump instead of highp on sampler2D's seems to be not enough for resolving the glitch; maybe hardwares w/o highp support need to be forbidden from advanced pipeline or some shaders need to be rewritten to be mediump-safe.
Agreement