[Mesa-dev] [Bug 71591] Second Life shaders fail to compile

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 18 01:19:15 PST 2013


Eero Tamminen <eero.t.tamminen at intel.com> changed:

           What    |Removed                     |Added
                 CC|                            |eero.t.tamminen at intel.com

--- Comment #4 from Eero Tamminen <eero.t.tamminen at intel.com> ---
E.g. Unigine's Heaven benchmark (v4.0) does this also.

It's a shame as that would be a nice test case for recently added geometry
shader and GL_ARB_sample_shading support in Mesa.  93 of the shaders in Heaven
benchmark (= nearly half of them) have:
  #extension GL_ARB_sample_shading : enable

And in none of them it's at the start.  There are no other extension

(In reply to comment #3)
> This seems a common mistake.  I think we should consider applying it in
> upstream mesa too, for sake of compatability.

All the Heaven shaders have main().  I think they're concatenated together from
different parts and in that case it makes sense to declare extensions required
by given part of shader, in the beginning of that part.

Program needing to keep track of what extensions are require by different
shader parts is inconvenient, especially if those concatenated parts can be
edited separately from the program (they e.g. come from disk).

(In reply to comment #1)
> According to the GLSL specification (1.30, page 14), #extension directives
> must come before any non-preprocessor tokens.

The spec says:
"Each extension can define its allowed granularity of scope. If nothing is
said, the granularity is a shader (that is, a single compilation unit), and the
extension directives must occur before any non-preprocessor tokens."

What if extension defines its allowed scope?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131118/97fc834f/attachment.html>

More information about the mesa-dev mailing list