[Mesa-dev] [PATCH 4/5] radeonsi: fix binding the dummy pixel shader

Michel Dänzer michel at daenzer.net
Thu Dec 5 19:08:24 PST 2013


On Don, 2013-12-05 at 18:43 +0100, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This fixes valgrind errors in glxinfo.

[...]

> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index 9831fd8..b644d56 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -2282,15 +2282,12 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
>  	if (rctx->vs_shader == sel)
>  		return;
>  
> -	rctx->vs_shader = sel;
> -
> -	if (sel && sel->current) {
> -		si_pm4_bind_state(rctx, vs, sel->current->pm4);
> -		rctx->b.streamout.stride_in_dw = sel->so.stride;
> -	} else {
> -		si_pm4_bind_state(rctx, vs, rctx->dummy_pixel_shader->pm4);
> -	}
> +	if (!sel || !sel->current)
> +		return;
>  
> +	rctx->vs_shader = sel;
> +	si_pm4_bind_state(rctx, vs, sel->current->pm4);
> +	rctx->b.streamout.stride_in_dw = sel->so.stride;
>  	rctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE;
>  }

I've been wondering for a while if it's a good idea to use the dummy
pixel shader as the vertex shader... It might be safer to just not draw
anything if there is no vertex shader, or is there anything sensible a
dummy vertex shader could do?

Anyway, this patch doesn't make that situation any worse than it is.
Also, while I'm not a big fan of the way patch 5 duplicates the same
comment everywhere, I guess it's better than no comments...

So, this series is

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer



More information about the mesa-dev mailing list