<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 - Compute shader compiling fails for invalid input layout qualifier used"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=106996">106996</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compute shader compiling fails for invalid input layout qualifier used
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>17.1
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>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>Mesa core
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>xinghua.cao@intel.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Steps:
1. Attached file is the source code;
2. build the source code, "gcc -o compileshader compileshader.c -lX11 -lepoxy";
3. run executable file, "./compileshader", mesa explicitly reports "invalid
input layout qualifier used", compute shader compiling fails.

Notes:
1. I am nearly sure that this issue is not mesa bug. It is possible that my
shader is not correct, but I could not find the root cause, so I file the bug
to get some help.

2. Compute shader is as below, defines a user-defined function, with image type
parameter, if uses "in" key to qualify the parameter, error happens, but if
remove "in" and "out" keys, shader compiling successfully. Quotes OpenGL ES
GLSL 3.1 spec section 6.1.1, "A function parameter declared with no such
qualifier(in, out, inout) means the same thing as specifying in". Here
explicitly specifies "in" key, why reports an error.
#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(r32ui, binding = 0) uniform readonly highp uimage2D uImage_1;
layout(r32ui, binding = 1) uniform writeonly highp uimage2D uImage_2;
void dataCopy(in readonly highp uimage2D src, out writeonly highp uimage2D dst,
ivec2 pos)
{
    uvec4 value = imageLoad(src, pos);
    imageStore(dst, pos, value);
}
void main()
{
    dataCopy(uImage_1, uImage_2, ivec2(gl_LocalInvocationID.xy));
}</pre>
        </div>
      </p>


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

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