[Mesa-dev] [PATCH 6/7] gallium/radeon: remove predicate_drawing flag

Nicolai Hähnle nhaehnle at gmail.com
Mon Nov 9 01:55:32 PST 2015


On 08.11.2015 22:48, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
>   src/gallium/drivers/r600/r600_hw_context.c    | 2 +-
>   src/gallium/drivers/r600/r600_state_common.c  | 2 +-
>   src/gallium/drivers/radeon/r600_pipe_common.h | 1 -
>   src/gallium/drivers/radeon/r600_query.c       | 1 -
>   src/gallium/drivers/radeonsi/si_state_draw.c  | 2 +-
>   5 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
> index 44e7cf2..2383175 100644
> --- a/src/gallium/drivers/r600/r600_hw_context.c
> +++ b/src/gallium/drivers/r600/r600_hw_context.c
> @@ -81,7 +81,7 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
>   	}
>
>   	/* Count in render_condition(NULL) at the end of CS. */
> -	if (ctx->b.predicate_drawing) {
> +	if (ctx->b.current_render_cond) {
>   		num_dw += 3;
>   	}

Aside: What is this actually trying to count? The way I understand 
conditional drawing now, there is no reset state that we have to emit at 
the end of the CS (other than for the queries themselves, but AFAIU that 
is already counted by num_cs_dw_nontimer_queries_suspend above). Perhaps 
this block could actually be dropped entirely?

Cheers,
Nicolai

>
> diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
> index 28aedff..5cf5208 100644
> --- a/src/gallium/drivers/r600/r600_state_common.c
> +++ b/src/gallium/drivers/r600/r600_state_common.c
> @@ -1478,7 +1478,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
>   	struct pipe_draw_info info = *dinfo;
>   	struct pipe_index_buffer ib = {};
>   	struct radeon_winsys_cs *cs = rctx->b.gfx.cs;
> -	bool render_cond_bit = rctx->b.predicate_drawing && !rctx->b.render_cond_force_off;
> +	bool render_cond_bit = rctx->b.current_render_cond && !rctx->b.render_cond_force_off;
>   	uint64_t mask;
>
>   	if (!info.indirect && !info.count && (info.indexed || !info.count_from_stream_output)) {
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
> index 09465ae..ba9000f 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -421,7 +421,6 @@ struct r600_common_context {
>   	struct pipe_query		*current_render_cond;
>   	unsigned			current_render_cond_mode;
>   	boolean				current_render_cond_cond;
> -	bool				predicate_drawing;
>   	bool				render_cond_force_off; /* for u_blitter */
>
>   	/* MSAA sample locations.
> diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
> index 145b629..9f92587 100644
> --- a/src/gallium/drivers/radeon/r600_query.c
> +++ b/src/gallium/drivers/radeon/r600_query.c
> @@ -834,7 +834,6 @@ static void r600_render_condition(struct pipe_context *ctx,
>   	rctx->current_render_cond = query;
>   	rctx->current_render_cond_cond = condition;
>   	rctx->current_render_cond_mode = mode;
> -	rctx->predicate_drawing = query != NULL;
>
>   	/* Compute the size of SET_PREDICATION packets. */
>   	atom->num_dw = 0;
> diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
> index ebc01e8..79e8876 100644
> --- a/src/gallium/drivers/radeonsi/si_state_draw.c
> +++ b/src/gallium/drivers/radeonsi/si_state_draw.c
> @@ -457,7 +457,7 @@ static void si_emit_draw_packets(struct si_context *sctx,
>   {
>   	struct radeon_winsys_cs *cs = sctx->b.gfx.cs;
>   	unsigned sh_base_reg = sctx->shader_userdata.sh_base[PIPE_SHADER_VERTEX];
> -	bool render_cond_bit = sctx->b.predicate_drawing && !sctx->b.render_cond_force_off;
> +	bool render_cond_bit = sctx->b.current_render_cond && !sctx->b.render_cond_force_off;
>
>   	if (info->count_from_stream_output) {
>   		struct r600_so_target *t =
>



More information about the mesa-dev mailing list