[Mesa-dev] [PATCH 1/2] radeonsi: fix viewport clipping handling.

Marek Olšák maraeo at gmail.com
Sat Dec 19 10:00:26 PST 2015


On Sat, Dec 19, 2015 at 3:16 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at 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 <airlied at 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 */
>         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) |

Are you sure about this? AFAIK, this is only needed if viewport_index
*is* written, but is constant and the reuse is on. Since the driver
has no idea if viewport_index is constant, there is no reason to set
this bit.

Marek


More information about the mesa-dev mailing list