<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Using a shared global uniform struct in both vertex and fragment shader prevents the program from linking"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=74819">74819</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>Using a shared global uniform struct in both vertex and fragment shader prevents the program from linking
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>arseny.kapoulkine@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=93822" name="attach_93822" title="Patch for glsl/linker.cpp that fixes the issue">attachment 93822</a> <a href="attachment.cgi?id=93822&action=edit" title="Patch for glsl/linker.cpp that fixes the issue">[details]</a></span>
Patch for glsl/linker.cpp that fixes the issue

The GLSL specification says that it's valid to have a global that's using a
structure in both vertex and fragment shader, as long as the structure
definition (name, field names and field types) matches.

Mesa GLSL linker does not do this analysis and instead just flags this as an
error in cross_validate_globals.

Additionally, the spec allows global explicitly sized arrays with the same
name; looks like this case is not handled as well.

I'm attaching a patch that resolves this by verifying that struct/array
field/order matches before giving the error.</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>