{R_028204_PA_SC_WINDOW_SCISSOR_TL, 0},
{R_028208_PA_SC_WINDOW_SCISSOR_BR, 0},
{R_02820C_PA_SC_CLIPRECT_RULE, 0},
- {R_028210_PA_SC_CLIPRECT_0_TL, 0},
- {R_028214_PA_SC_CLIPRECT_0_BR, 0},
- {R_028218_PA_SC_CLIPRECT_1_TL, 0},
- {R_02821C_PA_SC_CLIPRECT_1_BR, 0},
- {R_028220_PA_SC_CLIPRECT_2_TL, 0},
- {R_028224_PA_SC_CLIPRECT_2_BR, 0},
- {R_028228_PA_SC_CLIPRECT_3_TL, 0},
- {R_02822C_PA_SC_CLIPRECT_3_BR, 0},
{R_028230_PA_SC_EDGERULE, 0},
{R_028234_PA_SU_HARDWARE_SCREEN_OFFSET, 0},
{R_028238_CB_TARGET_MASK, 0},
{
}
-static void evergreen_set_scissor_state(struct pipe_context *ctx,
- const struct pipe_scissor_state *state)
-{
- struct r600_context *rctx = (struct r600_context *)ctx;
- struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
- uint32_t tl, br;
-
- if (rstate == NULL)
- return;
-
- rstate->id = R600_PIPE_STATE_SCISSOR;
- tl = S_028240_TL_X(state->minx) | S_028240_TL_Y(state->miny);
- br = S_028244_BR_X(state->maxx) | S_028244_BR_Y(state->maxy);
- r600_pipe_state_add_reg(rstate,
- R_028210_PA_SC_CLIPRECT_0_TL, tl,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_028214_PA_SC_CLIPRECT_0_BR, br,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_028218_PA_SC_CLIPRECT_1_TL, tl,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_02821C_PA_SC_CLIPRECT_1_BR, br,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_028220_PA_SC_CLIPRECT_2_TL, tl,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_028224_PA_SC_CLIPRECT_2_BR, br,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_028228_PA_SC_CLIPRECT_3_TL, tl,
- NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_02822C_PA_SC_CLIPRECT_3_BR, br,
- NULL, 0);
-
- free(rctx->states[R600_PIPE_STATE_SCISSOR]);
- rctx->states[R600_PIPE_STATE_SCISSOR] = rstate;
- r600_context_pipe_state_set(rctx, rstate);
-}
-
static void evergreen_set_viewport_state(struct pipe_context *ctx,
const struct pipe_viewport_state *state)
{
rctx->context.set_framebuffer_state = evergreen_set_framebuffer_state;
rctx->context.set_polygon_stipple = evergreen_set_polygon_stipple;
rctx->context.set_sample_mask = evergreen_set_sample_mask;
- rctx->context.set_scissor_state = evergreen_set_scissor_state;
rctx->context.set_stencil_ref = r600_set_pipe_stencil_ref;
rctx->context.set_vertex_buffers = r600_set_vertex_buffers;
rctx->context.set_index_buffer = r600_set_index_buffer;
enum r600_pipe_state_id {
R600_PIPE_STATE_CONFIG,
R600_PIPE_STATE_SEAMLESS_CUBEMAP,
- R600_PIPE_STATE_SCISSOR,
R600_PIPE_STATE_VIEWPORT,
R600_PIPE_STATE_RASTERIZER,
R600_PIPE_STATE_VGT,
si_pm4_set_state(rctx, clip, pm4);
}
+static void si_set_scissor_state(struct pipe_context *ctx,
+ const struct pipe_scissor_state *state)
+{
+ struct r600_context *rctx = (struct r600_context *)ctx;
+ struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
+ uint32_t tl, br;
+
+ if (pm4 == NULL)
+ return;
+
+ tl = S_028240_TL_X(state->minx) | S_028240_TL_Y(state->miny);
+ br = S_028244_BR_X(state->maxx) | S_028244_BR_Y(state->maxy);
+ si_pm4_set_reg(pm4, R_028210_PA_SC_CLIPRECT_0_TL, tl);
+ si_pm4_set_reg(pm4, R_028214_PA_SC_CLIPRECT_0_BR, br);
+ si_pm4_set_reg(pm4, R_028218_PA_SC_CLIPRECT_1_TL, tl);
+ si_pm4_set_reg(pm4, R_02821C_PA_SC_CLIPRECT_1_BR, br);
+ si_pm4_set_reg(pm4, R_028220_PA_SC_CLIPRECT_2_TL, tl);
+ si_pm4_set_reg(pm4, R_028224_PA_SC_CLIPRECT_2_BR, br);
+ si_pm4_set_reg(pm4, R_028228_PA_SC_CLIPRECT_3_TL, tl);
+ si_pm4_set_reg(pm4, R_02822C_PA_SC_CLIPRECT_3_BR, br);
+
+ si_pm4_set_state(rctx, scissor, pm4);
+}
+
void si_init_state_functions(struct r600_context *rctx)
{
rctx->context.create_blend_state = si_create_blend_state;
rctx->context.set_blend_color = si_set_blend_color;
rctx->context.set_clip_state = si_set_clip_state;
+ rctx->context.set_scissor_state = si_set_scissor_state;
}
struct si_state_blend *blend;
struct si_pm4_state *blend_color;
struct si_pm4_state *clip;
+ struct si_pm4_state *scissor;
} named;
struct si_pm4_state *array[0];
};