[Mesa-dev] [PATCH 17/17] radeonsi: fold info->indirect conditionals into the last one in draw_vbo
Nicolai Hähnle
nhaehnle at gmail.com
Mon Jan 30 10:02:54 UTC 2017
I have one comment/question on patch #16. Apart from that, the series is
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 26.01.2017 17:04, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/drivers/radeonsi/si_state_draw.c | 25 +++++++++++++------------
> 1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
> index e4a6b7f..1dd6dcc 100644
> --- a/src/gallium/drivers/radeonsi/si_state_draw.c
> +++ b/src/gallium/drivers/radeonsi/si_state_draw.c
> @@ -1089,34 +1089,35 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
> }
> }
>
> /* VI reads index buffers through TC L2. */
> if (info->indexed && sctx->b.chip_class <= CIK &&
> r600_resource(ib.buffer)->TC_L2_dirty) {
> sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
> r600_resource(ib.buffer)->TC_L2_dirty = false;
> }
>
> - if (info->indirect && r600_resource(info->indirect)->TC_L2_dirty) {
> - sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
> - r600_resource(info->indirect)->TC_L2_dirty = false;
> - }
> + if (info->indirect) {
> + /* Add the buffer size for memory checking in need_cs_space. */
> + r600_context_add_resource_size(ctx, info->indirect);
>
> - if (info->indirect_params &&
> - r600_resource(info->indirect_params)->TC_L2_dirty) {
> - sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
> - r600_resource(info->indirect_params)->TC_L2_dirty = false;
> - }
> + if (r600_resource(info->indirect)->TC_L2_dirty) {
> + sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
> + r600_resource(info->indirect)->TC_L2_dirty = false;
> + }
>
> - /* Add buffer sizes for memory checking in need_cs_space. */
> - if (info->indirect)
> - r600_context_add_resource_size(ctx, info->indirect);
> + if (info->indirect_params &&
> + r600_resource(info->indirect_params)->TC_L2_dirty) {
> + sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
> + r600_resource(info->indirect_params)->TC_L2_dirty = false;
> + }
> + }
>
> si_need_cs_space(sctx);
>
> /* Since we've called r600_context_add_resource_size for vertex buffers,
> * this must be called after si_need_cs_space, because we must let
> * need_cs_space flush before we add buffers to the buffer list.
> */
> if (!si_upload_vertex_buffer_descriptors(sctx))
> return;
>
>
More information about the mesa-dev
mailing list