[Mesa-dev] [PATCH 26/41] i965/gen6: Manipulate state batches for HiZ meta-ops

Eric Anholt eric at anholt.net
Fri Nov 18 17:38:11 PST 2011


On Thu, 17 Nov 2011 19:58:53 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> A lot of the state manipulation is handled by the meta-op state setup.
> However, some batches need manual intervention.
> 
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_draw.c          |    9 ++++++++-
>  src/mesa/drivers/dri/i965/gen6_clip_state.c   |   17 +++++++++++++++++
>  src/mesa/drivers/dri/i965/gen6_depthstencil.c |   22 ++++++++++++++++++++--
>  src/mesa/drivers/dri/i965/gen6_sf_state.c     |   15 +++++++++++++--
>  src/mesa/drivers/dri/i965/gen6_wm_state.c     |   17 +++++++++++++++++
>  5 files changed, 75 insertions(+), 5 deletions(-)

> +   if (brw->hiz.op) {
> +      /* HiZ operations emit a rectangle primitive, which requires clipping to
> +       * be disabled. From page 10 of the Sandy Bridge PRM Volume 2 Part 1
> +       * Section 1.3 3D Primitives Overview:
> +       *    RECTLIST:
> +       *    Either the CLIP unit should be DISABLED, or the CLIP unit's Clip
> +       *    Mode should be set to a value other than CLIPMODE_NORMAL.
> +       */
> +      BEGIN_BATCH(4);
> +      OUT_BATCH(_3DSTATE_CLIP << 16 | (4 - 2));
> +      OUT_BATCH(0);
> +      OUT_BATCH(0);
> +      OUT_BATCH(0);
> +      ADVANCE_BATCH();
> +      return;
> +   }
> +
>     if (!ctx->Transform.DepthClamp)
>        depth_clamp = GEN6_CLIP_Z_TEST;

This test for brw->hiz.op should have some sort of state flag associated
with it in the brw_tracked_state struct.  Otherwise, you have no
guarantee that your upload function will get called.  Same goes for
other upload functions touched in this patch.
-------------- 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/20111118/0ee3404a/attachment.pgp>


More information about the mesa-dev mailing list