From de344209ad6825600a0d5bd7156a95cc8093e4a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 8 Apr 2018 21:12:24 -0400 Subject: [PATCH] radeonsi: inline 2 trivial state structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_blit.c | 2 +- src/gallium/drivers/radeonsi/si_gfx_cs.c | 4 ++-- src/gallium/drivers/radeonsi/si_pipe.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.h | 12 ++---------- src/gallium/drivers/radeonsi/si_state.c | 10 +++++----- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index bbdb5e8f271..bd20a900e69 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -57,7 +57,7 @@ void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op) util_blitter_save_depth_stencil_alpha(sctx->blitter, sctx->queued.named.dsa); util_blitter_save_stencil_ref(sctx->blitter, &sctx->stencil_ref.state); util_blitter_save_fragment_shader(sctx->blitter, sctx->ps_shader.cso); - util_blitter_save_sample_mask(sctx->blitter, sctx->sample_mask.sample_mask); + util_blitter_save_sample_mask(sctx->blitter, sctx->sample_mask); util_blitter_save_scissor(sctx->blitter, &sctx->scissors.states[0]); } diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index e864b627a96..1358010c63c 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -263,11 +263,11 @@ void si_begin_new_gfx_cs(struct si_context *ctx) /* CLEAR_STATE sets zeros. */ if (!has_clear_state || ctx->clip_state.any_nonzeros) si_mark_atom_dirty(ctx, &ctx->atoms.s.clip_state); - ctx->msaa_sample_locs.nr_samples = 0; + ctx->sample_locs_num_samples = 0; si_mark_atom_dirty(ctx, &ctx->atoms.s.msaa_sample_locs); si_mark_atom_dirty(ctx, &ctx->atoms.s.msaa_config); /* CLEAR_STATE sets 0xffff. */ - if (!has_clear_state || ctx->sample_mask.sample_mask != 0xffff) + if (!has_clear_state || ctx->sample_mask != 0xffff) si_mark_atom_dirty(ctx, &ctx->atoms.s.sample_mask); si_mark_atom_dirty(ctx, &ctx->atoms.s.cb_render_state); /* CLEAR_STATE sets zeros. */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 971ff19d799..052fef28eda 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -472,7 +472,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, sctx->blitter->draw_rectangle = si_draw_rectangle; sctx->blitter->skip_viewport_restore = true; - sctx->sample_mask.sample_mask = 0xffff; + sctx->sample_mask = 0xffff; if (sctx->chip_class >= GFX9) { sctx->wait_mem_scratch = (struct r600_resource*) diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 41f88b9688e..eef8e602fad 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -636,14 +636,6 @@ struct si_clip_state { bool any_nonzeros; }; -struct si_sample_locs { - unsigned nr_samples; -}; - -struct si_sample_mask { - uint16_t sample_mask; -}; - struct si_streamout_target { struct pipe_stream_output_target b; @@ -815,8 +807,8 @@ struct si_context { /* Atom declarations. */ struct si_framebuffer framebuffer; - struct si_sample_locs msaa_sample_locs; - struct si_sample_mask sample_mask; + unsigned sample_locs_num_samples; + uint16_t sample_mask; unsigned last_cb_target_mask; struct si_blend_color blend_color; struct si_clip_state clip_state; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 7205c6d6e37..87206892172 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3209,8 +3209,8 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx, if (has_msaa_sample_loc_bug) nr_samples = MAX2(nr_samples, 1); - if (nr_samples != sctx->msaa_sample_locs.nr_samples) { - sctx->msaa_sample_locs.nr_samples = nr_samples; + if (nr_samples != sctx->sample_locs_num_samples) { + sctx->sample_locs_num_samples = nr_samples; si_emit_sample_locations(cs, nr_samples); } @@ -4151,17 +4151,17 @@ static void si_set_sample_mask(struct pipe_context *ctx, unsigned sample_mask) { struct si_context *sctx = (struct si_context *)ctx; - if (sctx->sample_mask.sample_mask == (uint16_t)sample_mask) + if (sctx->sample_mask == (uint16_t)sample_mask) return; - sctx->sample_mask.sample_mask = sample_mask; + sctx->sample_mask = sample_mask; si_mark_atom_dirty(sctx, &sctx->atoms.s.sample_mask); } static void si_emit_sample_mask(struct si_context *sctx, struct si_atom *atom) { struct radeon_winsys_cs *cs = sctx->gfx_cs; - unsigned mask = sctx->sample_mask.sample_mask; + unsigned mask = sctx->sample_mask; /* Needed for line and polygon smoothing as well as for the Polaris * small primitive filter. We expect the state tracker to take care of -- 2.30.2