Bug 72607 - [llvmpipe] piglit glean fragProg1 Z-write test regression
Summary: [llvmpipe] piglit glean fragProg1 Z-write test regression
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-12-11 18:40 UTC by Vinson Lee
Modified: 2013-12-11 19:47 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-12-11 18:40:20 UTC
mesa: 00faf82832f3e6ef886abad246b50cc47b901c1f (master)

$ PIGLIT_TEST="Z-write test" ./bin/glean -t fragProg1 --quick
FAILURE:
  Program: Z-write test
  Expected Z: 0.25
  Observed Z: 0.5
fragProg1:  FAIL rgba8, db, z24, s8, accrgba16, win+pmap, id 33
	0 tests passed, 1 tests failed.

0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1 is the first bad commit
commit 0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1
Author: Matthew McClure <mcclurem@vmware.com>
Date:   Tue Nov 26 10:50:27 2013 -0800

    llvmpipe: clamp fragment shader depth write to the current viewport depth range.
    
    With this patch, generate_fs_loop will clamp any fragment shader depth writes
    to the viewport's min and max depth values. Viewport selection is determined
    by the geometry shader output for the viewport array index. If no index is
    specified, then the default viewport index is zero. Semantics for this path
    can be found in draw_clamp_viewport_idx and lp_clamp_viewport_idx.
    
    lp_jit_viewport was created to store viewport information visible to JIT code,
    and is validated when the LP_NEW_VIEWPORT dirty flag is set.
    
    lp_rast_shader_inputs is responsible for passing the viewport_index through
    the rasterizer stage to fragment stage (via lp_jit_thread_data).
    
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

:040000 040000 5ad276a912f00a8ab3c3f94484c19c7029423ac0 473a6b36e915ccc84a096e18d5a806dea2b5aee4 M	src
bisect run success
Comment 1 Matthew McClure 2013-12-11 18:51:18 UTC
A patch is in testing to implement the correct plumbing for ARB_depth_clamp. The fragment depth write was not clamping against the near/far depth range as specified here:

   How should the setting of the raster position function when depth
   clamping is enabled?

      RESOLUTION:  When setting the raster position, clamp the raster
      position zw to the range [min(n,f),max(n,f)] where n and f are
      the near and far depth range values.

See: http://www.opengl.org/registry/specs/ARB/depth_clamp.txt
Comment 2 Jose Fonseca 2013-12-11 19:47:05 UTC
I just pushed Matthew's fix for this:

commit e84a1ab3c400f819408a7ebe01c2325cd59d94d3
Author: Matthew McClure <mcclurem@vmware.com>
Date:   Tue Dec 10 13:10:03 2013 -0800

    llvmpipe: add plumbing for ARB_depth_clamp
    
    With this patch llvmpipe will adhere to the ARB_depth_clamp enabled state when
    clamping the fragment's zw value. To support this, the variant key now includes
    the depth_clamp state. key->depth_clamp is derived from pipe_rasterizer_state's
    (depth_clip == 0), thus depth clamp is only enabled when depth clip is disabled.
    
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>


It should be fixed now.


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.