<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Mesa incorrectly thinks #extension directive is in the middle of a shader"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89415">89415</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Mesa incorrectly thinks #extension directive is in the middle of a shader
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>glsl-compiler
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>idr@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dark_sylinc@yahoo.com.ar
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=113961" name="attach_113961" title="Vertex and Pixel shaders that fail compilation">attachment 113961</a> <a href="attachment.cgi?id=113961&action=edit" title="Vertex and Pixel shaders that fail compilation">[details]</a></span>
Vertex and Pixel shaders that fail compilation

Mesa incorrectly determines the #extension keyword is in the middle of a
shader, apparently because there are two blank spaces (or may be because of the
#version keyword).

>From the GLSL specs:
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**.

Attached is the vertex and pixel shader. Mesa complains the vertex shader has
its extension directive declared in the middle of the shader, even though it's
not.

The version used was from git 3d4d77a5dc7bc9f60d7845ff1d8d5b23f988232a which is
from today.
This shader compiles fine in both NVIDIA and AMD propietary drivers in both
Linux and Windows.

Additionally since this is a pedantic issue, I'd suggest on this error Mesa
should try to reparse the file again and only leave a warning. Since there's
already a patch that enables the extension keyword to be used in the middle of
a shader (see
<a href="http://lists.freedesktop.org/archives/mesa-dev/2014-July/062988.html">http://lists.freedesktop.org/archives/mesa-dev/2014-July/062988.html</a>)

I can be reached for further information if needed.

Cheers
Matias</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>