Bug 111247 - [WebGL Conformance] clipping work incorrectly on y-axis
Summary: [WebGL Conformance] clipping work incorrectly on y-axis
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords: bisected
Depends on:
Blocks:
 
Reported: 2019-07-29 10:06 UTC by xinghua
Modified: 2019-09-25 20:34 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
attachment-32383-0.html (1.73 KB, text/html)
2019-07-29 10:09 UTC, Yang Gu
Details
attachment-14342-0.html (1.74 KB, text/html)
2019-08-28 20:27 UTC, Yang Gu
Details

Description xinghua 2019-07-29 10:06:58 UTC
The issue exists on mesa master, and is a regression on mesa, it does not exist on mesa-19.1.2.
Steps:
1. Use mesa master libraries.
2. Download latest chrome, and open https://www.khronos.org/registry/webgl/sdk/tests/deqp/functional/gles3/clipping.html?webglVersion=2&quiet=0&quick=1
3. One case fail.

Case details:
1. Drawing window size (128, 128), set viewport (38, 25, 76, 64), viewport size(76, 64)
2. Draw lines(line_width = 5)
3. On x-axis, lines,
   {(-1+1/76, -0.17218), (1+1/76, -0.17218)}  // This line width is 76
   {(-1-1/76, 0.2028), (1-1/76, 0.2028)}      // This line width is 75, one lack at the line end.
   {(-1+1/76, 0.5153), (1-1/76, 0.5153)}      // This line width is 75, one lack at the line end.
   The behaviors are the same on mesa and reference.
4. on y-axis, lines,
   {(-0.1976, -1+1/64), (-0.1976, 1+1/64)} // On mesa line height is 63, one lack at the line begin; but line height is 64 on reference.
   {(0.2234, -1-1/64), (0.2234, 1-1/64)}  // On mesa line height is 64; but line height is 63 on reference, one lack at the line end.
   {(0.5128, -1+1/64),(0.5128, 1-1/64)}   // line heights are all 63, but one lack is at the line begin on mesa, and the other is at the line end on reference.
   The x-axis and y-axis behaviors are different on mesa.
Comment 1 Yang Gu 2019-07-29 10:09:05 UTC
Created attachment 144904 [details]
attachment-32383-0.html

Yang is attending SIGGRAPH 2019, and email response will be slow.
Comment 2 Lionel Landwerlin 2019-07-29 11:45:05 UTC
Bisected to :

commit 488692426266bc14138410bc98f6e3a6390e3788
Author: Heinrich Fink <heinrich.fink@daqri.com>
Date:   Tue Jun 4 17:19:47 2019 +0200

    mesa: Enable GL_MESA_framebuffer_flip_y for GL 4.3
Comment 3 Denis 2019-07-29 12:17:02 UTC
hi Lionel. Got absolutely the same bisect results, testing few patches from our devs, unsuccessfully yet
Comment 4 Denis 2019-07-29 12:48:34 UTC
upd - want to mention that for FF there are 2 cases failed:

FAIL clipping.wide_lines_full_viewport: 
FAIL clipping.wide_lines_partial_viewport: 

They can't be bisected (tested on 17.1.1, 18.0.3, 19.1.2 (system) and mesa-git master)
Comment 5 Mark Janes 2019-07-29 20:25:31 UTC
FWIW the two tests that fail on FireFox skip on chromium with: 

  Skipping test due to tcuSkipList
Comment 6 Mark Janes 2019-07-30 01:55:41 UTC
Because this commit enables an extension, it is not clear that this bug identifies a regression in Mesa.   It may be that it enable an execution path that is buggy (in Chrome or in Mesa)

Denis: can you see if the same tests fail on the specified commit in Firefox?

Full set of tests that fail as described:

webgl.conformance.textures.canvas_sub_rectangle.tex-2d-rgb-rgb-unsigned_byte
webgl.conformance.textures.canvas_sub_rectangle.tex-2d-rgb-rgb-unsigned_short_5_6_5
webgl.conformance.textures.canvas_sub_rectangle.tex-2d-rgba-rgba-unsigned_byte
webgl.conformance.textures.canvas_sub_rectangle.tex-2d-rgba-rgba-unsigned_short_4_4_4_4
webgl.conformance.textures.canvas_sub_rectangle.tex-2d-rgba-rgba-unsigned_short_5_5_5_1
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r11f_g11f_b10f-rgb-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r11f_g11f_b10f-rgb-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r16f-red-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r16f-red-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r32f-red-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-r8-red-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rg16f-rg-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rg32f-rg-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rg8-rg-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rg8ui-rg_integer-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb16f-rgb-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb16f-rgb-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb32f-rgb-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb565-rgb-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb565-rgb-unsigned_short_5_6_5
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb5_a1-rgba-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb8-rgb-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb8ui-rgb_integer-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb9_e5-rgb-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgb9_e5-rgb-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba16f-rgba-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba16f-rgba-half_float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba32f-rgba-float
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba4-rgba-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba4-rgba-unsigned_short_4_4_4_4
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba8-rgba-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-rgba8ui-rgba_integer-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-srgb8-rgb-unsigned_byte
webgl.conformance2.textures.canvas_sub_rectangle.tex-2d-srgb8_alpha8-rgba-unsigned_byte
webgl.deqp.functional.gles3.clipping
Comment 7 Denis 2019-07-30 07:37:48 UTC
(In reply to Mark Janes from comment #5)
> FWIW the two tests that fail on FireFox skip on chromium with: 
> 
>   Skipping test due to tcuSkipList

hmm, for me 1 is passing, and one is failing (that one, reported in the ticket)
>Chromium	75.0.3770.100 (Official Build) Arch Linux (64-bit)
___________
Start testcase: clipping.narrow_lines_partial_viewport
PASS clipping.narrow_lines_partial_viewport: 

__________

Start testcase: clipping.wide_lines_partial_viewport
Image comparison failed: threshold = [3,3,3,3]
Result 
 BufferAccess(format: TextureFormat(RGBA, UNORM_INT8), width: 76, height: 64)
 
Reference 
 BufferAccess(format: TextureFormat(RGBA, UNORM_INT8), width: 76, height: 64)
 
Error error mask
 BufferAccess(format: TextureFormat(RGB, UNORM_INT8), width: 76, height: 64)
 
FAIL clipping.wide_lines_partial_viewport: 

>Denis: can you see if the same tests fail on the specified commit in Firefox?
Sure, I will check them. According to the failed test cases in FF, I tested even on bisected commit and on master, they always fail in FF, and 1 pass, 1 fail - in Chromium.
Comment 8 Denis 2019-07-30 09:52:29 UTC
Please check test results below. As I am not sure, what info is directly related to current issue, I provided all outputs for tests/runs. Fill free to separate/skip those, who are not related to current issue.


I ran the whole suites => 
all/conformance2/textures/canvas_sub_rectangle 
all/conformance/textures/canvas_sub_rectangle

https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html?version=2.0.1
https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html?version=1.0.4
_____________________________________
>Mesa master (from 27.07)

Firefox failures:

    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-3d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",

Chromium failures:

    "conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html",
_________________
!!!!!!!!!!!!!Side note!!!!!!!!!!!!!!! (I think I can bisect it, notify plz if this is needed):
These two cases also look like regression, because they didn't fail on 19.1.2 and "bisected" commit.

   "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_byte.html",
   "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_byte.html"
________________

_____________________________________
>Mesa system (19.1.2)

Firefox failures:

    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-3d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",

Chromium failures:

no failures.
_____________________________________

>Mesa bisected commit (git-4886924262)

Firefox failures:

    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-3d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",

Chromium failures:

    "conformance2/textures/canvas_sub_rectangle/tex-2d-r8-red-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r16f-red-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r32f-red-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg8-rg-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg16f-rg-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg32f-rg-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8-rgb-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb9_e5-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb32f-rgb-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_byte.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgb10_a2-rgba-unsigned_int_2_10_10_10_rev.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-half_float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba16f-rgba-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba32f-rgba-float.html",
    "conformance2/textures/canvas_sub_rectangle/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html",
_____________________________________


all/conformance/textures/canvas_sub_rectangle
____________________________________________________
>Mesa bisected commit (git-4886924262)

Firefox failures:

no failures

Chromium failures:

no failures
____________________________________________________
Comment 9 Fritz Koenig 2019-08-22 16:25:20 UTC
I see a few issues in this bug.  I dug into the clipping issue as it applies to GL_MESA_framebuffer_flip_y in (https://bugs.chromium.org/p/chromium/issues/detail?id=964010#c22)

My takeaway was that Mesa was performing differently with system framebuffers and user framebuffers.  GL_MESA_framebuffer_flip_y allows the user framebuffer to follow the path of the system framebuffer and therefore come out upside down. 
 But, according to the spec they are both correct because of the diamond exit rule.

I'm also a little confused how this is affecting FF.  Chromium is using the extension for GLES.  Is FF also using the extension?  Or did enabling this extension change the functionality of Mesa when the extension did not enabled?
Comment 10 Yang Gu 2019-08-28 20:27:56 UTC
Created attachment 145192 [details]
attachment-14342-0.html

Yang is on vacation from Aug 26 to 29, and email response will be slow.
Comment 11 Tapani Pälli 2019-08-29 08:45:06 UTC
(In reply to Fritz Koenig from comment #9)
> I see a few issues in this bug.  I dug into the clipping issue as it applies
> to GL_MESA_framebuffer_flip_y in
> (https://bugs.chromium.org/p/chromium/issues/detail?id=964010#c22)
> 
> My takeaway was that Mesa was performing differently with system
> framebuffers and user framebuffers.  GL_MESA_framebuffer_flip_y allows the
> user framebuffer to follow the path of the system framebuffer and therefore
> come out upside down. 
>  But, according to the spec they are both correct because of the diamond
> exit rule.
> 
> I'm also a little confused how this is affecting FF.  Chromium is using the
> extension for GLES.  Is FF also using the extension?  Or did enabling this
> extension change the functionality of Mesa when the extension did not
> enabled?

Independent of what's going on with FF, this bug is easy to reproduce with chrome. I noticed that the subtest starts to pass if I disable GL_MESA_framebuffer_flip_y extension in i965 driver, maybe chrome does something wrong when the extension is enabled?
Comment 12 Daniel Stone 2019-08-29 08:49:01 UTC
The commit this is bisected to enables an extension on OpenGL. The same extension is present in GLES, and the test would presumably fail in the same way on GLES (from the initial code enable in 488692426266) if it was executed there.

It's also not clear where the bug actually lies.
Comment 13 Yunchao He 2019-08-29 23:22:46 UTC
Corresponding ChromeOS bug: https://bugs.chromium.org/p/chromium/issues/detail?id=973917

And Google found another issue on ChromeOS when enable GL_MESA_framebuffer_flip_y: https://bugs.chromium.org/p/chromium/issues/detail?id=996323. This issue happened in Intel CMAA shader.
Comment 14 GitLab Migration User 2019-09-25 20:34:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1822.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.