[Mesa-dev] [PATCH] glsl: Allow precision mismatch on dead uniform with GLSL ES 1.00 (v3)

Kenneth Graunke kenneth at whitecape.org
Mon Nov 6 23:18:04 UTC 2017


On Thursday, October 19, 2017 9:02:20 PM PST Tomasz Figa wrote:
> Hi Ian, Kenneth,
> 
> On Wed, Sep 27, 2017 at 2:57 AM, Tomasz Figa <tfiga at chromium.org> 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 uniforms that are declared but not used
> > further in shader code. The problem affects a big number of Android
> > games, including ones built on top of one of the common 2D graphics
> > engines and other GLES implementations accept this, which 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 word "used" is not clear in this context and might refer to
> >  1) declared (same as GLES 3.x)
> >  2) referred after post-processing, or
> >  3) linked after all optimizations are done.
> >
> > Looking at existing applications, 2) or 3) seems to be widely adopted.
> > To avoid compatibility issues, turn the error into a warning if GLSL ES
> > version is lower than 3.0 and the data is dead in at least one of the
> > shaders.
> >
> > v3:
> >  - Add a comment explaining the behavior.
> >  - Fix bad copy/paste in commit message (s/varyings/uniforms).
> 
> Would you be able to take a look?
> 
> Ian, I believe your previous NAK was due to the confusing erroneous
> copy/paste from the freedesktop bug I made in commit message. Looking
> at last comment from Kenneth there, we were going to go with my patch,
> but things remained quiet after that.
> 
> Thanks,
> Tomasz

Sorry, this completely fell off my radar.  I've gone ahead and pushed
your patch.  Dylan also sent out Piglit tests for this case today, which
I've reviewed.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171106/3e4aad32/attachment.sig>


More information about the mesa-dev mailing list