Bug 77223 - [BDW]Piglit spec_ARB_texture_cube_map_copyteximage_CUBE_samples=2 fails
Summary: [BDW]Piglit spec_ARB_texture_cube_map_copyteximage_CUBE_samples=2 fails
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Kenneth Graunke
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-09 07:09 UTC by lu hua
Modified: 2014-04-25 05:37 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description lu hua 2014-04-09 07:09:08 UTC
System Environment:
--------------------------
Platform: Broadwell
Libdrm:		(master)libdrm-2.4.52-10-g1cb5fc706cf5913d9dee33c939f65a23ecea17a5
Mesa:		(master)159cec9dec2320d821d388c0df8140c7705b6e0b
Xserver:	(master)xorg-server-1.15.99.901-204-g901fbfbbbd71c0d82080957f8ba09eebbc786f2b
Xf86_video_intel:(master)2.99.911-44-g3310ee89c1f1a663de5f5b12b8125809a213996f
Cairo:		(master)bb17403622e9ea474017e0039af8ee48b2b285db
Libva:		(staging)960352aaf1e11891a533ce2c98b16edde24d6851
Libva_intel_driver:(staging)150f67c67bd92cd201b75a92388fe3a63b00cd8a
Kernel:	(drm-intel-nightly) 7cd8b823493acc320c7db9112de9d4e21c6dbd11

Bug detailed description:
-----------------------------
It fails on Broadwell with Mesa master branch, but work well on Haswell.
Following cases also fail:
spec_ARB_texture_cube_map_copyteximage_CUBE_samples=4
spec_ARB_texture_cube_map_copyteximage_CUBE_samples=6
spec_ARB_texture_cube_map_copyteximage_CUBE_samples=8
spec_ARB_texture_rectangle_copyteximage_RECT_samples=2
spec_ARB_texture_rectangle_copyteximage_RECT_samples=4
spec_ARB_texture_rectangle_copyteximage_RECT_samples=6
spec_ARB_texture_rectangle_copyteximage_RECT_samples=8

output:
Testing GL_TEXTURE_CUBE_MAP
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RED
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RG
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGB8
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGB16
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGB16F
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGB32F
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGBA8
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGBA16
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGBA16F
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_RGBA32F
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_COMPRESSED_RED
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_COMPRESSED_RG
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_COMPRESSED_RGB
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_COMPRESSED_RGBA
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_LUMINANCE
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_LUMINANCE_ALPHA
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_INTENSITY
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH_COMPONENT
Probe color at (288,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (288,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (288,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (288,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (288,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (288,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH_COMPONENT16
Probe color at (304,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (304,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (304,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (304,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (304,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (304,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH_COMPONENT24
Probe color at (320,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (320,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (320,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (320,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (320,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (320,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH_COMPONENT32F
Probe color at (336,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (336,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (336,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (336,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (336,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (336,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH24_STENCIL8
Probe color at (352,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (352,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (352,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (352,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (352,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (352,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Texture target = GL_TEXTURE_CUBE_MAP, Internal format = GL_DEPTH32F_STENCIL8
Probe color at (368,0)
  Expected: 0.750000 0.750000 0.750000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (368,0)
  Expected: 0.637500 0.637500 0.637500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (368,0)
  Expected: 0.525000 0.525000 0.525000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (368,0)
  Expected: 0.412500 0.412500 0.412500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (368,0)
  Expected: 0.300000 0.300000 0.300000 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
Probe color at (368,0)
  Expected: 0.187500 0.187500 0.187500 1.000000
  Observed: 0.501961 0.501961 0.501961 1.000000
PIGLIT: {'result': 'fail' }


Reproduce steps:
----------------------------
1. xinit
2. ./bin/copyteximage CUBE -samples=2 -auto
Comment 1 Kenneth Graunke 2014-04-18 18:59:14 UTC
This appears to be a bug with fast depth clears or HiZ.  They work if you run with hiz=false.
Comment 2 Kenneth Graunke 2014-04-19 06:26:39 UTC
This works if you disable fast depth clears.

It also works if you add a PIPE_CONTROL with a TC flush at the end of gen8_hiz_exec.  I found documentation saying we may need a DEPTH_CACHE_FLUSH and DEPTH_STALL, but nothing about a TC flush.  Need to investigate more...
Comment 3 Kenneth Graunke 2014-04-21 21:09:12 UTC
Patch on mailing list:
http://lists.freedesktop.org/archives/mesa-dev/2014-April/058178.html
Comment 4 lu hua 2014-04-22 06:23:19 UTC
(In reply to comment #3)
> Patch on mailing list:
> http://lists.freedesktop.org/archives/mesa-dev/2014-April/058178.html

Fixed by this patch.
Comment 5 Kenneth Graunke 2014-04-22 17:57:54 UTC
Fixed by:

commit 34a68345e228b7cbc1bc6909704a89c08bf5368e
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Apr 21 14:08:49 2014 -0700

    i965: Make Broadwell HiZ path arrange for TC flushes.
    
    HiZ operations make the depth/render caches out of sync with the sampler
    caches.  We need to arrange for a TC flush to happen before the target
    buffer is used by the sampler.  Calling brw_render_cache_set_add_bo
    makes that happen.
    
    On previous generations, brw_blorp_exec took care of flushing the
    texture cache by calling intel_batchbuffer_emit_mi_flush after doing
    any rendering.  If we were to use the normal drawing path, then
    brw_postdraw_set_buffers_need_resolve would handle this.
    
    On Broadwell, we don't use BLORP, and we don't emit a rectangle
    primitive via the normal drawing path.  The 3DSTATE_WM_HZ_OP and
    PIPE_CONTROL implicitly make drawing happen.  So, none of our existing
    code makes this flush happen - we need to do it directly.
    
    Fixes 11 Piglit copyteximage subtests.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77223
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77226
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt <eric@anholt.net>
Comment 6 lu hua 2014-04-25 05:37:56 UTC
Verified.Fixed.


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.