Mesa (master): i965: Cite the Sandybridge PRM for Gen7 stencil pitch requirements.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Jul 16 02:52:26 UTC 2013


Module: Mesa
Branch: master
Commit: 9a86875c6b3245769367f3f42d9452e6de15b0bd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a86875c6b3245769367f3f42d9452e6de15b0bd

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jul 10 13:35:31 2013 -0700

i965: Cite the Sandybridge PRM for Gen7 stencil pitch requirements.

Sadly, the Ivybridge PRM can't be cited, as it is missing the relevant
text for some reason.  However, the Sandybridge PRM has the text Chad
originally quoted, and the modern BSpec has the same text.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/gen7_misc_state.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_misc_state.c b/src/mesa/drivers/dri/i965/gen7_misc_state.c
index fe63fef..7f61881 100644
--- a/src/mesa/drivers/dri/i965/gen7_misc_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_misc_state.c
@@ -97,19 +97,15 @@ gen7_emit_depth_stencil_hiz(struct brw_context *brw,
 
       BEGIN_BATCH(3);
       OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER << 16 | (3 - 2));
-      /* The stencil buffer has quirky pitch requirements.  From the Graphics
-       * BSpec: vol2a.11 3D Pipeline Windower > Early Depth/Stencil Processing
-       * > Depth/Stencil Buffer State > 3DSTATE_STENCIL_BUFFER [DevIVB+],
-       * field "Surface Pitch":
+      /* The stencil buffer has quirky pitch requirements.  From the
+       * Sandybridge PRM, Volume 2 Part 1, page 329 (3DSTATE_STENCIL_BUFFER
+       * dword 1 bits 16:0 - Surface Pitch):
        *
        *    The pitch must be set to 2x the value computed based on width, as
        *    the stencil buffer is stored with two rows interleaved.
        *
-       * (Note that it is not 100% clear whether this intended to apply to
-       * Gen7; the BSpec flags this comment as "DevILK,DevSNB" (which would
-       * imply that it doesn't), however the comment appears on a "DevIVB+"
-       * page (which would imply that it does).  Experiments with the hardware
-       * indicate that it does.
+       * While the Ivybridge PRM lacks this comment, the BSpec contains the
+       * same text, and experiments indicate that this is necessary.
        */
       OUT_BATCH(enabled |
 	        (2 * stencil_mt->region->pitch - 1));




More information about the mesa-commit mailing list