Bug 77312 - wine's d3d8/9 visual tests fail on i965
Summary: wine's d3d8/9 visual tests fail on i965
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 10.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-11 08:39 UTC by austinenglish@gmail.com
Modified: 2019-03-26 12:41 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
glxinfo (16.34 KB, text/plain)
2014-04-11 10:09 UTC, austinenglish@gmail.com
Details
trace with issue on Intel (2.17 MB, application/octet-stream)
2019-03-18 15:48 UTC, asimiklit
Details
Small explanation of a wine test (84.84 KB, image/png)
2019-03-18 16:08 UTC, asimiklit
Details

Description austinenglish@gmail.com 2014-04-11 08:39:32 UTC
d3d8:
visual.c:2728: Test failed: Expected color 0x0000ff00 at 400,60, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 560,60, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x0000ff00 at 400,180, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 560,180, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x0000ff00 at 80,300, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x0000ff00 at 240,300, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x0000ff00 at 400,300, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 560,300, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 80,420, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 240,420, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 400,420, got 0x000000ff.
visual.c:2728: Test failed: Expected color 0x00ff0000 at 560,420, got 0x000000ff.

d3d9:

visual.c:12337: Test failed: Expected color 0x0000ff00 at 400,60, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 560,60, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x0000ff00 at 400,180, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 560,180, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x0000ff00 at 80,300, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x0000ff00 at 240,300, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x0000ff00 at 400,300, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 560,300, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 80,420, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 240,420, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 400,420, got 0x000000ff.
visual.c:12337: Test failed: Expected color 0x00ff0000 at 560,420, got 0x000000ff.

Fedora 20

[austin@localhost ~]$ yum list installed | grep -e intel -e mesa
mesa-dri-drivers.i686                  10.0.4-1.20140312.fc20          @updates 
mesa-dri-drivers.x86_64                10.0.4-1.20140312.fc20          @updates 
mesa-filesystem.i686                   10.0.4-1.20140312.fc20          @updates 
mesa-filesystem.x86_64                 10.0.4-1.20140312.fc20          @updates 
mesa-libEGL.i686                       10.0.4-1.20140312.fc20          @updates 
mesa-libEGL.x86_64                     10.0.4-1.20140312.fc20          @updates 
mesa-libEGL-devel.x86_64               10.0.4-1.20140312.fc20          @updates 
mesa-libGL.i686                        10.0.4-1.20140312.fc20          @updates 
mesa-libGL.x86_64                      10.0.4-1.20140312.fc20          @updates 
mesa-libGL-devel.i686                  10.0.4-1.20140312.fc20          @updates 
mesa-libGL-devel.x86_64                10.0.4-1.20140312.fc20          @updates 
mesa-libGLU.i686                       9.0.0-4.fc20                    @updates 
mesa-libGLU.x86_64                     9.0.0-4.fc20                    @updates 
mesa-libGLU-devel.i686                 9.0.0-4.fc20                    @updates 
mesa-libGLU-devel.x86_64               9.0.0-4.fc20                    @updates 
mesa-libOSMesa.x86_64                  10.0.4-1.20140312.fc20          @updates 
mesa-libOSMesa-devel.x86_64            10.0.4-1.20140312.fc20          @updates 
mesa-libgbm.i686                       10.0.4-1.20140312.fc20          @updates 
mesa-libgbm.x86_64                     10.0.4-1.20140312.fc20          @updates 
mesa-libglapi.i686                     10.0.4-1.20140312.fc20          @updates 
mesa-libglapi.x86_64                   10.0.4-1.20140312.fc20          @updates 
mesa-libwayland-egl.x86_64             10.0.4-1.20140312.fc20          @updates 
mesa-libxatracker.x86_64               10.0.4-1.20140312.fc20          @updates 
xorg-x11-drv-intel.x86_64              2.21.15-5.fc20                  @updates
Comment 1 austinenglish@gmail.com 2014-04-11 10:08:41 UTC
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
        Subsystem: Acer Incorporated [ALI] Device 071a
        Flags: bus master, fast devsel, latency 0, IRQ 44
        Memory at c1000000 (64-bit, non-prefetchable) [size=4M]
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 3000 [size=64]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [a4] PCI Advanced Features
        Kernel driver in use: i915
Comment 2 austinenglish@gmail.com 2014-04-11 10:09:06 UTC
Created attachment 97217 [details]
glxinfo
Comment 3 austinenglish@gmail.com 2014-04-27 07:10:22 UTC
I see the same failure with LIBGL_ALWAYS_SOFTWARE=1.
Comment 4 asimiklit 2019-03-18 15:48:30 UTC
Created attachment 143726 [details]
trace with issue on Intel

I tested this issue and it still there.

I using qapitrace to check results of a frame 0.
Intel shows just a blue screen
Radeon shows a small blue rect in a green rect which is in a red rect.
I will attach that screens here shortly.
Comment 5 asimiklit 2019-03-18 16:08:20 UTC
Created attachment 143727 [details]
Small explanation of a wine test

I am still working on a piglit test for this issue:
https://gitlab.freedesktop.org/mesa/piglit/merge_requests/18

and on a mesa fix for it:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/466

Seems 'Step 2' mentioned on the attached picture doesn't
work on Intel. It just clean (with depth value 0.0) the whole
depth buffer size ignoring the scissors and as result depth test 
doesn't accept green and red rectangles at all because their z > 0.0.
Comment 6 asimiklit 2019-03-20 09:47:04 UTC
I tested an Iris driver with MR "iris: Add fast clear support." using my piglit test and this issue isn't reproduced there. Gallium state tracker function 'is_scissor_enabled' checks a depth render buffer size (and this behavior looks more correct for me):
https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/mesa/state_tracker/st_cb_clear.c#L469-479

instead of a frame buffer size, like in i965:
https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/mesa/drivers/dri/i965/brw_clear.c#L117-127
Comment 7 andrii simiklit 2019-03-25 21:27:36 UTC
I made a mistake, this isn't a mesa issue.
According to ARB_framebuffer_object spec:

  "- If the attachment sizes are not all identical, rendering will be
   limited to the largest area that can fit in all of the
   attachments (i.e. an intersection of rectangles having a lower
   left of (0,0) and an upper right of (width,height) for each
   attachment)

   - If the attachment sizes are not all identical, the values of
   pixels outside the common intersection area after rendering are
   undefined."

So this is rather a wine issue.
************************
*   depth              *
*                      *
***********            *
* color   *            *
*         *            *
*         *            *
************************
Because it does not expect that depth buffer will be
modified outside the scissors area which is equal
to intersection area.

But Mesa feels free to do everything with pixels(depth)
outside the intersection area even to clean them.

Gallium behaves here in another way it just leaves
a depth buffer outside the intersection untouched.
Comment 8 asimiklit 2019-03-26 09:51:51 UTC
(In reply to andrii simiklit from comment #7)
> I made a mistake, this isn't a mesa issue.
> According to ARB_framebuffer_object spec:
> 
>   "- If the attachment sizes are not all identical, rendering will be
>    limited to the largest area that can fit in all of the
>    attachments (i.e. an intersection of rectangles having a lower
>    left of (0,0) and an upper right of (width,height) for each
>    attachment)
> 
>    - If the attachment sizes are not all identical, the values of
>    pixels outside the common intersection area after rendering are
>    undefined."
> 
> So this is rather a wine issue.
> ************************
> *   depth              *
> *                      *
> ***********            *
> * color   *            *
> *         *            *
> *         *            *
> ************************
> Because it does not expect that depth buffer will be
> modified outside the scissors area which is equal
> to intersection area.
> 
> But Mesa feels free to do everything with pixels(depth)
> outside the intersection area even to clean them.
> 
> Gallium behaves here in another way it just leaves
> a depth buffer outside the intersection untouched.

Based on opengl calls the original wine test makes the following steps:
1. creates a fbo (FA)
2. creates a depth buffer (DA) with size 640x480
3. creates a color buffer (CA) with the same size 640x480
4. attaches (CA) and (DA) to (FA)
5. calls a glClear  with depth 1.0 and blue color using (FA)
6. creates another fbo (FB)
7. creates a color buffer (CB) with size 320x240
8. attaches (CB) and (DA) to (FB)
9. setups a scissors area for 320x240
10. calls a glClear with depth 0.0 and white color using (FB)

Test expects that the depth outside 320x240 area
is not modified and there is still 1.0 but according
to spec which was mentioned above this is undefined behavior.

I suggest to close this issue as a not mesa issue.
Comment 9 asimiklit 2019-03-26 12:29:15 UTC
I redirected this issue to wine bugzilla:
https://bugs.winehq.org/show_bug.cgi?id=46917


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.