[Mesa-dev] [PATCH 3/3] i965: Apply miptree workaround for very small depth buffers.

Eric Anholt eric at anholt.net
Mon Jul 25 19:36:33 PDT 2011


On Mon, 25 Jul 2011 17:07:09 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> According to the documentation for 3DSTATE_DEPTH_BUFFER (G45 and
> beyond), the 3 LSBs of "Depth Coordinate Offset X" (and Y) must be 0.
> 
> Detect this and apply the Gen4 miptree hack for working around
> unsupported offsets.
> 
> Fixes piglit test fbo-clear-formats for GL_ARB_depth_texture and
> GL_EXT_packed_depth_stencil on Ivybridge.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/intel/intel_fbo.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
> index f00943e..7ea81e0 100644
> --- a/src/mesa/drivers/dri/intel/intel_fbo.c
> +++ b/src/mesa/drivers/dri/intel/intel_fbo.c
> @@ -649,7 +649,8 @@ intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
>  #ifndef I915
>  static bool
>  need_tile_offset_workaround(struct brw_context *brw,
> -			    struct intel_renderbuffer *irb)
> +			    struct intel_renderbuffer *irb,
> +			    bool is_depthbuffer)
>  {
>     uint32_t tile_x, tile_y;
>  
> @@ -658,6 +659,12 @@ need_tile_offset_workaround(struct brw_context *brw,
>     if (!brw->has_surface_tile_offset)
>        return tile_x != 0 || tile_y != 0;
>  
> +   /* In 3DSTATE_DEPTH_BUFFER, the 3 LSBs of Depth Coordinate Offset X/Y
> +    * must be zero.  We need the workaround in those cases.
> +    */
> +   if (is_depthbuffer)
> +      return (tile_x & 0x3) != 0 || (tile_y & 0x3) != 0;
> +

& 0x3 would be just checking 2 lsbs, right?

(which suggests that our analysis of this being the root cause of the
failure is wrong, since the 3rd lsb being set for the 2x2 mipmap didn't
fail)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110725/14ed80fa/attachment.pgp>


More information about the mesa-dev mailing list