Commit 43f414f7 authored by Christian König's avatar Christian König
Browse files

radeonsi: move scissor state to new state handling


Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
parent 9cbbe0d4
......@@ -81,14 +81,6 @@ static const struct r600_reg si_context_reg_list[] = {
{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},
......
......@@ -1254,49 +1254,6 @@ static void evergreen_set_sample_mask(struct pipe_context *pipe, unsigned sample
{
}
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)
{
......@@ -1709,7 +1666,6 @@ void cayman_init_state_functions(struct r600_context *rctx)
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;
......
......@@ -77,7 +77,6 @@ struct r600_atom_surface_sync {
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,
......
......@@ -216,6 +216,30 @@ static void si_set_clip_state(struct pipe_context *ctx,
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;
......@@ -224,4 +248,5 @@ void si_init_state_functions(struct r600_context *rctx)
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;
}
......@@ -40,6 +40,7 @@ union si_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];
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment