[Mesa-dev] [PATCH] radeonsi: fix mask checking when emitting scissors and viewports

Grigori Goronzy greg at chown.ath.cx
Mon Apr 11 16:38:20 UTC 2016


On 2016-04-08 11:00, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> ---
>  src/gallium/drivers/radeonsi/si_state.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_state.c
> b/src/gallium/drivers/radeonsi/si_state.c
> index 8087d23..3894e1d 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -912,8 +912,10 @@ static void si_emit_scissors(struct si_context
> *sctx, struct r600_atom *atom)
>  	bool scissor_enable = sctx->queued.named.rasterizer->scissor_enable;
> 
>  	/* The simple case: Only 1 viewport is active. */
> -	if (mask & 1 &&
> -	    !si_get_vs_info(sctx)->writes_viewport_index) {
> +	if (!si_get_vs_info(sctx)->writes_viewport_index) {
> +		if (!(mask & 1))
> +			return;
> +

Reviewed-by: Grigori Goronzy <greg at chown.ath.cx>

I also noticed this when I tried to implement the guard band feature. 
E.g. OpenArena will often needlessly emit scissors for all 16 viewports 
without this.

Grigori


More information about the mesa-dev mailing list