Bug 31673 - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES
GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
All All
: medium minor
Assigned To: mesa-dev
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-16 16:21 UTC by Kenneth Graunke
Modified: 2010-11-17 12:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Graunke 2010-11-16 16:21:56 UTC
According to the GLSL ES specification, section 4.5,

"The built-in macro GL_FRAGMENT_PRECISION_HIGH is defined to one on systems supporting highp precision in the fragment language

   #define GL_FRAGMENT_PRECISION_HIGH 1

and is not defined on systems not supporting highp precision in the fragment language.  When defined, this macro is available in both the vertex and fragment languages.  The highp qualifier is an optional feature in the fragment language and is not enabled by #extension."

glcpp currently does not define this macro for GLSL ES.  As far as I know, all Mesa drivers currently support highp, so perhaps we should just define it unconditionally.  However, I imagine this may not always be the case...
Comment 1 Kenneth Graunke 2010-11-17 12:56:26 UTC
commit 302fe4049c1f409655eb283e20f9ab6397ac3db4
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Wed Nov 17 12:53:07 2010 -0800

    Regenerate glcpp parser.

commit d719bf8fb4b8f511fbb00dd990fb644efc510c0e
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Wed Nov 17 12:50:35 2010 -0800

    glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
    
    This is really supposed to be defined only if the driver supports highp
    in the fragment shader - but all of our current ES2 implementations do.
    So, just define it.  In the future, we'll need to add a flag to
    gl_context and only define the macro if the flag is set.
    
    "Fixes" freedesktop.org bug #31673.