Bug 82885 - [G965] piglit.spec.arb_shader_texture_lod.execution.tex-miplevel-selection *gradarb cube fails
Summary: [G965] piglit.spec.arb_shader_texture_lod.execution.tex-miplevel-selection *g...
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-21 02:41 UTC by lu hua
Modified: 2019-09-25 18:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
output (18.82 KB, text/plain)
2014-08-21 02:41 UTC, lu hua
Details
Expected output of the test (from NVIDIA proprietary driver) (14.40 KB, image/png)
2014-09-29 09:54 UTC, Samuel Iglesias Gonsálvez
Details
SNB output (4.35 KB, image/png)
2014-09-29 09:55 UTC, Samuel Iglesias Gonsálvez
Details
SNB output disabling meta fast clear color path (8.38 KB, image/png)
2014-09-29 09:55 UTC, Samuel Iglesias Gonsálvez
Details
INTEL_DEBUG=fs output (6.80 KB, text/plain)
2014-09-29 10:01 UTC, Samuel Iglesias Gonsálvez
Details

Description lu hua 2014-08-21 02:41:50 UTC
Created attachment 104998 [details]
output

System Environment:
--------------------------
Platform: SNB
Libdrm:		(master)libdrm-2.4.56-8-gd9ce09de12131fa8c5ff2d7c2dbd6b61d8a5fd14
Mesa:		(master)a1853eaea7fa5caf59b52567cc49f964ce5293ec
Xserver:	(master)xorg-server-1.15.99.902-121-g2f5cf9ff9a0f713b7e038636484c77f113a5f10a
Xf86_video_intel:(master)2.99.914-60-gf5469681b620d9d6ccaf53e92ed31f931cb03b0d
Libva:		(master)acfcd5f0637a951d50c5112c7dfbd46f1d0dcdb3
Libva_intel_driver:(master)f3f49f2f0e6b3669d9b09341a11cf0b96e138674
Kernel:   (drm-intel-nightly)49ceddc7b3b0e3f7eb21b9fb4c9b840cff630047

Bug detailed description:
---------------------------
New case spec_ARB_shader_texture_lod_execution_tex-miplevel-selection_*GradARB_Cube fails on i965 platforms with mesa master branch and mesa 10.2 branch.

Reproduce steps:
---------------------------- 
1. xinit
2. bin/tex-miplevel-selection *GradARB Cube -fbo -auto
Comment 1 lu hua 2014-08-21 02:46:21 UTC
spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_Cube
spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_CubeArray
spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_CubeShadow
above 3 cases fail on SNB+ platforms.
Comment 2 Samuel Iglesias Gonsálvez 2014-09-16 15:49:02 UTC
I have run the test on an IvyBridge laptop against Mesa 10.1.3 (Ubuntu's version) and Mesa 9.2.5 (tagged from the repo). In both cases the issue was reproduced.
Comment 3 Samuel Iglesias Gonsálvez 2014-09-29 09:54:33 UTC
Created attachment 107052 [details]
Expected output of the test (from NVIDIA proprietary driver)
Comment 4 Samuel Iglesias Gonsálvez 2014-09-29 09:55:24 UTC
Created attachment 107053 [details]
SNB output
Comment 5 Samuel Iglesias Gonsálvez 2014-09-29 09:55:58 UTC
Created attachment 107054 [details]
SNB output disabling meta fast clear color path
Comment 6 Samuel Iglesias Gonsálvez 2014-09-29 10:01:45 UTC
Created attachment 107055 [details]
INTEL_DEBUG=fs output
Comment 7 Samuel Iglesias Gonsálvez 2014-09-29 10:16:02 UTC
I spent some time looking into this issue and I have some discoveries to share:

* This issue is reproducible in Ironlake with master branch (66a2fe4cf95f6d4f5bdbfd740314113e87e5649b).

* I first though that the issue could be related something specific to cube map textures but test "bin/tex-miplevel-selection *Lod Cube" passes. So, I compared the INTEL_DEBUG=fs of the latter program with the reported in the bug, they are almost the same: the difference is in the number of parameters sent to the sampler and the uniforms received in the payload. I also read the SNB documentation to check that INTEL_DEBUG=fs is giving the expected output for both cases.

* Then I was suspicious of a misconfigured state message (3DSTATE_WM, 3DSTATE_CONSTANT_PS, SURFACE_STATE, sampling engine messages). After comparing its setup in the source code with SNB documentation, I have not found any misconfigured flag but I could be wrong as it might be something very subtle to be seen at first glance.

* In gen6_update_renderbuffer_surface(), when the gl_target is a cube map texture, the surface type is changed to SURFACE_2D with its depth multiply by 6 (as the cube map has six faces). I modified it but no change in the output. Furthermore, as it is working for other cases (see test in second bullet), I don't think this is related to this bug.

* As this tests renders into each texture by using only glClear() commands, then I looked at the meta fast color clear path. I found that commenting out the meta fast color clear path in brw_clear(), then some color patterns appeared in the output... but they are still wrong (see attachments).

So, I'm running out of ideas to continue analyzing this bug. Maybe someone with more experience in that part of the source code has some ideas that could be worth to try or point out where I made a mistake in my analysis.
Comment 8 Iago Toral 2015-03-05 12:33:04 UTC
I sent a patch for review to the mailing list that fixes this as well as a bunch of similar dEQP tests:
http://lists.freedesktop.org/archives/mesa-dev/2015-February/077733.html
Comment 9 lu hua 2015-03-09 06:27:12 UTC
(In reply to Iago Toral from comment #8)
> I sent a patch for review to the mailing list that fixes this as well as a
> bunch of similar dEQP tests:
> http://lists.freedesktop.org/archives/mesa-dev/2015-February/077733.html

Apply this patch, It works well.
output:
libGL: OpenDriver: trying /opt/X11R7/lib/dri/tls/i965_dri.so
libGL: OpenDriver: trying /opt/X11R7/lib/dri/i965_dri.so
Summary: 58212/58212 passed
PIGLIT: {"result": "pass" }
Comment 10 Rhys Kidd 2015-06-20 05:03:30 UTC
Based on Ironlake, my reports from running this piglit test:

Master Mesa (afeb92220690c8f27cdc56c30e109ca175d51d83)
======================================================
PASS

Mesa 10.5.2
======================================================
Failure:
  Expected level: 0
  Observed: wrong layer/face/slice or wrong level or wrong offset
  Fetch level: 0, baselevel: 0, maxlevel: 0, minlod: 0, maxlod: 0, bias: -5, mipfilter: no
Failure:
  Expected level: 0
  Observed: wrong layer/face/slice or wrong level or wrong offset
  Fetch level: 0, baselevel: 0, maxlevel: 0, minlod: 0, maxlod: 0, bias: -5, mipfilter: yes
...

Looks to be resolved, at least on this hw.
Comment 11 Iago Toral 2015-07-14 08:58:36 UTC
(In reply to Rhys Kidd from comment #10)
> Based on Ironlake, my reports from running this piglit test:
> 
> Master Mesa (afeb92220690c8f27cdc56c30e109ca175d51d83)
> ======================================================
> PASS
> 
> Mesa 10.5.2
> ======================================================
> Failure:
>   Expected level: 0
>   Observed: wrong layer/face/slice or wrong level or wrong offset
>   Fetch level: 0, baselevel: 0, maxlevel: 0, minlod: 0, maxlod: 0, bias: -5,
> mipfilter: no
> Failure:
>   Expected level: 0
>   Observed: wrong layer/face/slice or wrong level or wrong offset
>   Fetch level: 0, baselevel: 0, maxlevel: 0, minlod: 0, maxlod: 0, bias: -5,
> mipfilter: yes
> ...
> 
> Looks to be resolved, at least on this hw.

That is odd, the tests require GL version 3 and Ironlake only supports 2.1. I have in fact tried to run the test in an Ironlake laptop and the test is skipped warning that it does not support the required GL version. That is with Mesa master (ea633db65f) and piglit's master.
Comment 12 Iago Toral 2015-07-14 09:00:19 UTC
(In reply to lu hua from comment #9)
> (In reply to Iago Toral from comment #8)
> > I sent a patch for review to the mailing list that fixes this as well as a
> > bunch of similar dEQP tests:
> > http://lists.freedesktop.org/archives/mesa-dev/2015-February/077733.html
> 
> Apply this patch, It works well.
> output:
> libGL: OpenDriver: trying /opt/X11R7/lib/dri/tls/i965_dri.so
> libGL: OpenDriver: trying /opt/X11R7/lib/dri/i965_dri.so
> Summary: 58212/58212 passed
> PIGLIT: {"result": "pass" }

By the way, this patch was merged in master a few weeks ago.
Comment 13 Matt Turner 2016-11-03 00:19:52 UTC
All platforms but G965 were fixed by

commit 2b1cdb0eddb73f62e4848d4b64840067f1f70865
Author: Iago Toral Quiroga <itoral@igalia.com>
Date:   Tue Feb 24 19:02:50 2015 +0100

    i965: Fix textureGrad with cube samplers
Comment 14 GitLab Migration User 2019-09-25 18:52:19 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/1452.


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.