<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - The big SKQP bug"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105301#c26">Comment # 26</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - The big SKQP bug"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105301">bug 105301</a>
              from <span class="vcard"><a class="email" href="mailto:dongseong.hwang@intel.com" title="Dongseong Hwang <dongseong.hwang@intel.com>"> <span class="fn">Dongseong Hwang</span></a>
</span></b>
        <pre>Kenneth, actually skqp assigns SRC1 by glBindFragDataLocationIndexed. However,
skia bindw two varying out variables to (number=0, index=0) and (number=0,
index=1). Is it legal? I cannot find the spec preventing this usage. 
<a href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt">https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt</a>

In the spec, LinkProgram to fail "if more than one varying out variable is
bound to the same number and index". However, it doesn't explicitly prohibit
that more than one varying out variable is bound to the same number but
different index..

Here's how skia work

* FBO with only one color attachment
3104 @0 glBindFramebuffer(target = GL_FRAMEBUFFER, framebuffer = 1)
3106 @0 glFramebufferTexture2D(target = GL_FRAMEBUFFER, attachment =
GL_COLOR_ATTACHMENT0, textarget = GL_TEXTURE_2D, texture = 1, level = 0)

* Compile fs and bind two varying out variables to (number=0, index=0) and
(number=0, index=1).
3418 @0 glShaderSource(shader = 9, count = 1, string = ["#version 320 es

precision mediump float;
uniform highp vec4 sk_RTAdjust;
uniform highp vec2 uAtlasSizeInv_Stage0;
in highp vec2 inPosition;
in mediump vec4 inColor;
in mediump uvec2 inTextureCoords;
out highp vec2 vTextureCoords_Stage0;
flat out highp int vTexIndex_Stage0;
out mediump vec4 vinColor_Stage0;
void main() {
    highp ivec2 signedCoords = ivec2(int(inTextureCoords.x),
int(inTextureCoords.y));
    highp int texIdx = 2 * (signedCoords.x & 1) + (signedCoords.y & 1);
    highp vec2 unormTexCoords = vec2(float(signedCoords.x / 2),
float(signedCoords.y / 2));
    vTextureCoords_Stage0 = unormTexCoords * uAtlasSizeInv_Stage0;
    vTexIndex_Stage0 = texIdx;
    vinColor_Stage0 = inColor;
    gl_Position = vec4(inPosition.x, inPosition.y, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww *
sk_RTAdjust.yw, 0.0, gl_Position.w);
}
"], length = [877])

3432 @0 glBindFragDataLocationEXT(program = 7, color = 0, name = sk_FragColor)
3434 @0 glBindFragDataLocationIndexedEXT(program = 7, colorNumber = 0, index =
1, name = fsSecondaryColorOut)
3439 @0 glLinkProgram(program = 7)

* set BlendFunc with SRC1
3459 @0 glBlendFunc(sfactor = GL_ONE, dfactor = GL_ONE_MINUS_SRC1_COLOR)

* draw and gpu hang
3489 @0 glVertexAttribPointer(index = 0, size = 2, type = GL_FLOAT, normalized
= GL_FALSE, stride = 16, pointer = 0x30)
3491 @0 glVertexAttribPointer(index = 1, size = 4, type = GL_UNSIGNED_BYTE,
normalized = GL_TRUE, stride = 16, pointer = 0x38)
3493 @0 glVertexAttribDivisor(index = 1, divisor = 0)
3495 @0 glVertexAttribIPointer(index = 2, size = 2, type = GL_UNSIGNED_SHORT,
stride = 16, pointer = 0x3c)
3497 @0 glVertexAttribDivisor(index = 2, divisor = 0)
3499 @0 glDrawRangeElements(mode = GL_TRIANGLES, start = 0, end = 31, count =
48, type = GL_UNSIGNED_SHORT, indices = NULL)</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>