[Mesa-dev] [PATCH] glsl: Allow precision mismatch on dead data with GLSL ES 1.00

Chad Versace chadversary at chromium.org
Tue Sep 26 22:40:33 UTC 2017


On Tue 26 Sep 2017, Tomasz Figa wrote:
> Commit 259fc505454ea6a67aeacf6cdebf1398d9947759 added linker error for
> mismatching uniform precision, as required by GLES 3.0 specification and
> conformance test-suite.
> 
> Several Android applications, including Forge of Empires, have shaders
> which violate this rule, on a dead varying that will be eliminated.
> The problem affects a big number of applications using Cocos2D engine
> and other GLES implementations accept this, this poses a serious
> application compatibility issue.
> 
> Starting from GLSL ES 3.0, declarations with conflicting precision
> qualifiers are explicitly prohibited. However GLSL ES 1.00 does not
> clearly specify the behavior, except that
> 
>   "Uniforms are defined to behave as if they are using the same storage in
>   the vertex and fragment processors and may be implemented this way.
>   If uniforms are used in both the vertex and fragment shaders, developers
>   should be warned if the precisions are different. Conversion of
>   precision should never be implicit."

The phrase "should be warned", directly from the GLSL ES 1.00 spec,
convinces me that this patch takes the right approach. (Even though the
next sentence contradicts the "should be warned" suggestion... Oh well,
the GLSL spec is embarassingly imprecise elsewhere too).

Reviewed-by: Chad Versace <chadversary at chromium.org>

Though my rb has less weight than the other people CC'd.

> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532
> Signed-off-by: Tomasz Figa <tfiga at chromium.org>


More information about the mesa-dev mailing list