[Mesa-dev] [PATCH 2/2] mesa: glsl: allow ES2 to report support for GLSL versions >= 1.20

Oliver McFadden oliver.mcfadden at linux.intel.com
Fri May 25 23:56:11 PDT 2012


On Fri, May 25, 2012 at 01:13:13PM -0700, Eric Anholt wrote:
> On Fri, 25 May 2012 16:16:30 +0300, Oliver McFadden <oliver.mcfadden at linux.intel.com> wrote:
> > This bug was discovered while running the Khronos conformance test suite
> > on i965 classic driver and receiving "implementation error: meta program
> > compile failed."
> > 
> > This bug was recently introduced by the i965 clear patch set and would
> > not be visible while using the GL API (only ES2 API) and only on gen6+
> > hardware (which claims support for GLSL 1.30)
> > 
> > Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
> 
> I don't think we should do this -- aren't you letting someone do
> #version 130 in their ES2 context?

Well, honestly I couldn't find any good reference on whether supporting
versions of GLSL > 100 is prohibited in ES2 contexts, and because we
need an ivec4 output color version 100 is insufficient.

> 
> In the past, for "let core Mesa do desktop GL things in an ES context",
> we've put some flag in place across linking.

As far as I could tell the error was being generated when Mesa compiled
the first shader with "ivec4" and "out" (both prohibited in GLSL 100.)

It would be a flag to the compiler, but again, I couldn't find any
helper function or variable to set internal hints. Otherwise I'd add a
"INTERNAL_META_CLEAR_SHADER" flag and just make the compiler STFU. ;-)

> But in this case, I think
> the right answer is to just have a separate shader string in the meta
> code for the ES2 case.

I am a bit confused. I could not find any documentation that states
supporting higher GLSL versions than 100 is prohibited on ES2, and
intel_extensions.c sets GLSLVersion = 130 for gen6+...

It could of course be that GLSL 130 is allowed on vanilla GL, but not
ES2. In which case it's a 1-liner to common/meta.c:

-   if (ctx->Const.GLSLVersion >= 130) {
+   if (ctx->API == API_OPENGL && ctx->Const.GLSLVersion >= 130) {

So long as we don't have an integer framebuffer anywhere, we're fine.
What do you think about the above proposal?

-- 
Oliver McFadden.


More information about the mesa-dev mailing list