[Mesa-dev] [PATCH 08/11] radeonsi: use a global dirty mask for shader pointers

Nicolai Hähnle nhaehnle at gmail.com
Wed Jan 18 12:50:36 UTC 2017


On 17.01.2017 23:47, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Only vertex buffers use a separate bool flag.
> ---
>  src/gallium/drivers/radeonsi/si_descriptors.c | 85 +++++++++++++++------------
>  src/gallium/drivers/radeonsi/si_pipe.h        |  2 +
>  src/gallium/drivers/radeonsi/si_state.h       |  2 -
>  src/gallium/drivers/radeonsi/si_state_draw.c  |  2 +-
>  4 files changed, 51 insertions(+), 40 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
> index a535fa0..deb6df9 100644
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c

[snip]

> @@ -1800,84 +1794,95 @@ void si_shader_change_notify(struct si_context *sctx)
>  		else
>  			si_set_user_data_base(sctx, PIPE_SHADER_TESS_EVAL,
>  					      R_00B130_SPI_SHADER_USER_DATA_VS_0);
>  	} else {
>  		si_set_user_data_base(sctx, PIPE_SHADER_TESS_EVAL, 0);
>  	}
>  }
>
>  static void si_emit_shader_pointer(struct si_context *sctx,
>  				   struct si_descriptors *desc,
> -				   unsigned sh_base, bool keep_dirty)
> +				   unsigned sh_base)
>  {
>  	struct radeon_winsys_cs *cs = sctx->b.gfx.cs;
>  	uint64_t va;
>
> -	if (!desc->pointer_dirty || !desc->buffer)
> -		return;
> +	assert(desc->buffer);
>
>  	va = desc->buffer->gpu_address +
>  	     desc->buffer_offset;
>
>  	radeon_emit(cs, PKT3(PKT3_SET_SH_REG, 2, 0));
>  	radeon_emit(cs, (sh_base + desc->shader_userdata_offset - SI_SH_REG_OFFSET) >> 2);
>  	radeon_emit(cs, va);
>  	radeon_emit(cs, va >> 32);
>
> -	desc->pointer_dirty = keep_dirty;

There's an empty line you can kill.

Nicolai


More information about the mesa-dev mailing list