Mesa (master): i965: Set "Position XY Offset Select" bits in 3DSTATE_PS on Broadwell.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Feb 19 23:41:06 UTC 2014


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Feb 10 17:31:00 2014 -0800

i965: Set "Position XY Offset Select" bits in 3DSTATE_PS on Broadwell.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/drivers/dri/i965/gen8_ps_state.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen8_ps_state.c b/src/mesa/drivers/dri/i965/gen8_ps_state.c
index 5b7aa34..c25b827 100644
--- a/src/mesa/drivers/dri/i965/gen8_ps_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_ps_state.c
@@ -184,6 +184,24 @@ upload_ps_state(struct brw_context *brw)
    if (brw->wm.prog_data->prog_offset_16)
       dw6 |= GEN7_PS_16_DISPATCH_ENABLE;
 
+   /* From the documentation for this packet:
+    * "If the PS kernel does not need the Position XY Offsets to
+    *  compute a Position Value, then this field should be programmed
+    *  to POSOFFSET_NONE."
+    *
+    * "SW Recommendation: If the PS kernel needs the Position Offsets
+    *  to compute a Position XY value, this field should match Position
+    *  ZW Interpolation Mode to ensure a consistent position.xyzw
+    *  computation."
+    *
+    * We only require XY sample offsets. So, this recommendation doesn't
+    * look useful at the moment. We might need this in future.
+    */
+   if (brw->wm.prog_data->uses_pos_offset)
+      dw6 |= GEN7_PS_POSOFFSET_SAMPLE;
+   else
+      dw6 |= GEN7_PS_POSOFFSET_NONE;
+
    dw7 |=
       brw->wm.prog_data->first_curbe_grf << GEN7_PS_DISPATCH_START_GRF_SHIFT_0 |
       brw->wm.prog_data->first_curbe_grf_16<< GEN7_PS_DISPATCH_START_GRF_SHIFT_2;




More information about the mesa-commit mailing list