[Bug 105301] The big SKQP bug

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Oct 30 18:21:28 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=105301

--- Comment #26 from Dongseong Hwang <dongseong.hwang at intel.com> ---
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. 
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt

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)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20181030/71311b4f/attachment.html>


More information about the intel-3d-bugs mailing list