<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ir_variable has maximum access out of bounds -- but it's not out of bounds"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=109532#c51">Comment # 51</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ir_variable has maximum access out of bounds -- but it's not out of bounds"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=109532">bug 109532</a>
              from <span class="vcard"><a class="email" href="mailto:andrey.simiklit@gmail.com" title="asimiklit <andrey.simiklit@gmail.com>"> <span class="fn">asimiklit</span></a>
</span></b>
        <pre>We have one more answer from Piers Daniell:
  "We discussed this in the OpenGL/ES working group meeting and agreed that
   eliminating unused elements from the interface block array is not desirable. 
   There is no statement in the spec that this takes place and it would be
highly 
   implementation dependent if it happens. If the application has an
"interface" in
   the shader they need to match up with the API it would be quite confusing to
have
   the binding point get compacted. So the answer is no, the binding points
aren't 
   affected by unused elements in the interface block array."

So looks like according to it we should remove this optimization at all.
Regardless whether explicit or implicit case we should not optimize it.
I guess we can remove this optimization for 'packed' blocks by
removing this exclusive cases and just handle it like 'std140' and 'shared'
layouts:

<a href="https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/compiler/glsl/link_uniform_block_active_visitor.cpp#L254-261">https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/compiler/glsl/link_uniform_block_active_visitor.cpp#L254-261</a>

and

<a href="https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/compiler/glsl/link_uniform_block_active_visitor.cpp#L170-171">https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/compiler/glsl/link_uniform_block_active_visitor.cpp#L170-171</a></pre>
        </div>
      </p>


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

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