diff options
author | Marek Olšák <marek.olsak@amd.com> | 2014-08-17 16:25:01 +0200 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2014-08-27 13:38:29 +0100 |
commit | 0374fdd5b6f70af36fca92abae5d8166e93d6372 (patch) | |
tree | 710f150114f07090dda9c540034feb9c04a37824 /src/gallium/drivers/radeonsi/si_state.c | |
parent | fa03aa9a8a605c1ba099178f82f0c9ccb6f5fdd8 (diff) |
radeonsi: save scissor state and sample mask for u_blitter
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 7792f9858b60fd9f9f037f1aa15dd21cba30f2c4)
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index d12bd01acbd..9bfa0951b0f 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -458,18 +458,20 @@ static void si_set_scissor_states(struct pipe_context *ctx, const struct pipe_scissor_state *state) { struct si_context *sctx = (struct si_context *)ctx; - struct si_pm4_state *pm4 = si_pm4_alloc_state(sctx); + struct si_state_scissor *scissor = CALLOC_STRUCT(si_state_scissor); + struct si_pm4_state *pm4 = &scissor->pm4; - if (pm4 == NULL) + if (scissor == NULL) return; + scissor->scissor = *state; si_pm4_set_reg(pm4, R_028250_PA_SC_VPORT_SCISSOR_0_TL, S_028250_TL_X(state->minx) | S_028250_TL_Y(state->miny) | S_028250_WINDOW_OFFSET_DISABLE(1)); si_pm4_set_reg(pm4, R_028254_PA_SC_VPORT_SCISSOR_0_BR, S_028254_BR_X(state->maxx) | S_028254_BR_Y(state->maxy)); - si_pm4_set_state(sctx, scissor, pm4); + si_pm4_set_state(sctx, scissor, scissor); } static void si_set_viewport_states(struct pipe_context *ctx, @@ -2823,16 +2825,18 @@ static void si_bind_sampler_states(struct pipe_context *ctx, unsigned shader, static void si_set_sample_mask(struct pipe_context *ctx, unsigned sample_mask) { struct si_context *sctx = (struct si_context *)ctx; - struct si_pm4_state *pm4 = si_pm4_alloc_state(sctx); + struct si_state_sample_mask *state = CALLOC_STRUCT(si_state_sample_mask); + struct si_pm4_state *pm4 = &state->pm4; uint16_t mask = sample_mask; - if (pm4 == NULL) + if (state == NULL) return; + state->sample_mask = mask; si_pm4_set_reg(pm4, R_028C38_PA_SC_AA_MASK_X0Y0_X1Y0, mask | (mask << 16)); si_pm4_set_reg(pm4, R_028C3C_PA_SC_AA_MASK_X0Y1_X1Y1, mask | (mask << 16)); - si_pm4_set_state(sctx, sample_mask, pm4); + si_pm4_set_state(sctx, sample_mask, state); } static void si_delete_sampler_state(struct pipe_context *ctx, void *state) |