Bug 31673

Summary: GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: medium    
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.