<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - Compilation is *very* slow."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=87103#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - Compilation is *very* slow."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=87103">bug 87103</a>
              from <span class="vcard"><a class="email" href="mailto:gonzhauser@yahoo.de" title="Gonz <gonzhauser@yahoo.de>"> <span class="fn">Gonz</span></a>
</span></b>
        <pre>This one takes 13 seconds to compile. Change n to 70 or 80 and it gets worse.

[require]
GLSL >= 1.30

[fragment shader]
out vec4 fragColor;

const int n = 60;

vec4 a[n];
vec4 b[n];
vec4 c[4];

void init() {
    for(int i = 0; i < n; ++i) {
        a[i] = vec4(0.1, 0, 0, 0);
        b[i] = vec4(0.1, 0, 0, 0);
    }
}

void prod(in vec4 a[n], in vec4 b[n], out vec4 result[4]) {
    result[0] = vec4(0);
    for(int i = 0; i < n; ++i) {
        result[0] += a[i] * b[i];
    }
}

void main()
{
    init();
    prod(a, b, c);
    fragColor = c[0];
}

[test]

draw rect -1 -1 2 2
probe all rgba 0.6 0.0 0.0 0.0</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>