On 18.12.2015 21:16, Dave Airlie wrote:
From: Dave Airlie <airl...@redhat.com>

If oViewport is written, vertex reuse need to be turned off.
If oViewport is constant, vertex reuse is fine, and VPORT_PROVOKE_DISABLE
need to be set.

Fixes: arb_viewport_array-render-viewport-2 and some CTS tests.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
  src/gallium/drivers/radeonsi/si_state.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 4086819..e3bce12 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -586,6 +586,7 @@ static void si_emit_clip_regs(struct si_context *sctx, 
struct r600_atom *atom)
        unsigned clipdist_mask =
                info->writes_clipvertex ? SIX_BITS : info->clipdist_writemask;

+       /* vport provoke should be set to 1 if oViewport isn't written */

The comment feels misleading to me. vport provoke should be disabled if oViewport isn't written, or perhaps vport provoke _disable_ should be set to 1.

        radeon_set_context_reg(cs, R_02881C_PA_CL_VS_OUT_CNTL,
                S_02881C_USE_VTX_POINT_SIZE(info->writes_psize) |
                S_02881C_USE_VTX_EDGE_FLAG(info->writes_edgeflag) |
@@ -604,7 +605,12 @@ static void si_emit_clip_regs(struct si_context *sctx, 
struct r600_atom *atom)
                sctx->queued.named.rasterizer->pa_cl_clip_cntl |
                (clipdist_mask ? 0 :
                 sctx->queued.named.rasterizer->clip_plane_enable & SIX_BITS) |
+               
S_028810_VTE_VPORT_PROVOKE_DISABLE(!info->writes_viewport_index) |
                S_028810_CLIP_DISABLE(window_space));
+
+       /* reuse needs to be set off if we write oViewport */
+       radeon_set_context_reg(cs, R_028AB4_VGT_REUSE_OFF,
+                              S_028AB4_REUSE_OFF(info->writes_viewport_index));
  }

  static void si_set_scissor_states(struct pipe_context *ctx,


Now that VGT_REUSE_OFF is also programmed in this atom, it should be possible to remove it from si_init_config, right?

Cheers,
Nicolai
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to