<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 - [softpipe] piglit unsized-array-not-in-last-position regression"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96254">96254</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[softpipe] piglit unsized-array-not-in-last-position regression
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

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

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

        <tr>
          <th>Keywords</th>
          <td>bisected, regression
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vlee@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>airlied@freedesktop.org, siglesias@igalia.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>mesa: fb2a5ceb3264123e94a5e3f4d92cf6ec605e76e8 (master 11.3.0-devel)

$ ./bin/glslparsertest
tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag
fail 1.20 GL_ARB_shader_storage_buffer_object
Successfully compiled fragment shader
tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag: 
Shader source:
// [config]
// expect_result: fail
// glsl_version: 1.20
// require_extensions: GL_ARB_shader_storage_buffer_object
// [end config]

#version 120
#extension GL_ARB_shader_storage_buffer_object: require

/* From the GL_ARB_shader_storage_buffer_object spec:
 *
 *     "In a shader storage block, the last member may be declared without an
 *     explicit size."
 */

buffer a {
        vec4 b;
        int c[];
        float d;
};

vec4 foo(void) {
        return b;
}

PIGLIT: {"result": "fail" }


5b2675093e863a52b610f112884ae12d42513770 is the first bad commit
commit 5b2675093e863a52b610f112884ae12d42513770
Author: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>>
Date:   Wed May 25 13:31:41 2016 +1000

    glsl: handle implicit sized arrays in ssbo

    The current code disallows unsized arrays except at the end of
    an SSBO but it is a bit overzealous in doing so.

    struct a {
        int b[];
        int f[4];
    };

    is valid as long as b is implicitly sized within the shader,
    i.e. it is accessed only by integer indices.

    I've submitted some piglit tests to test for this.

    This also has no regressions on piglit on my Haswell.
    This fixes:
    GL45-CTS.shader_storage_buffer_object.basic-syntax
    GL45-CTS.shader_storage_buffer_object.basic-syntaxSSO

    This patch moves a chunk of the linker code down, so
    that we don't link the uniform blocks until after we've
    merged all the variables. The logic went something like:

    Removing the checks for last ssbo member unsized from
    the compiler and into the linker, meant doing the check
    in the link_uniform_blocks code. However to do that the
    array sizing had to happen first, so we knew that the
    only unsized arrays were in the last block. But array
    sizing required the variable to be merged, otherwise
    you'd get two different array sizes in different
    version of two variables, and one would get lost
    when merged. So the solution was to move array sizing
    up, after variable merging, but before uniform block
    visiting.

    Reviewed-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>>
    Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>>

:040000 040000 86192aa213e706ebd8ac097144a34364c95c7233
b0fece865f8c1a2b6a1b656f628a4cd98b58b336 M      src
bisect run success</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>