{R_028448_PA_CL_VPORT_YOFFSET_0, 0},
{R_02844C_PA_CL_VPORT_ZSCALE_0, 0},
{R_028450_PA_CL_VPORT_ZOFFSET_0, 0},
- {R_0285BC_PA_CL_UCP_0_X, 0},
- {R_0285C0_PA_CL_UCP_0_Y, 0},
- {R_0285C4_PA_CL_UCP_0_Z, 0},
- {R_0285C8_PA_CL_UCP_0_W, 0},
- {R_0285CC_PA_CL_UCP_1_X, 0},
- {R_0285D0_PA_CL_UCP_1_Y, 0},
- {R_0285D4_PA_CL_UCP_1_Z, 0},
- {R_0285D8_PA_CL_UCP_1_W, 0},
- {R_0285DC_PA_CL_UCP_2_X, 0},
- {R_0285E0_PA_CL_UCP_2_Y, 0},
- {R_0285E4_PA_CL_UCP_2_Z, 0},
- {R_0285E8_PA_CL_UCP_2_W, 0},
- {R_0285EC_PA_CL_UCP_3_X, 0},
- {R_0285F0_PA_CL_UCP_3_Y, 0},
- {R_0285F4_PA_CL_UCP_3_Z, 0},
- {R_0285F8_PA_CL_UCP_3_W, 0},
- {R_0285FC_PA_CL_UCP_4_X, 0},
- {R_028600_PA_CL_UCP_4_Y, 0},
- {R_028604_PA_CL_UCP_4_Z, 0},
- {R_028608_PA_CL_UCP_4_W, 0},
- {R_02860C_PA_CL_UCP_5_X, 0},
- {R_028610_PA_CL_UCP_5_Y, 0},
- {R_028614_PA_CL_UCP_5_Z, 0},
- {R_028618_PA_CL_UCP_5_W, 0},
{R_028644_SPI_PS_INPUT_CNTL_0, 0},
{R_028648_SPI_PS_INPUT_CNTL_1, 0},
{R_02864C_SPI_PS_INPUT_CNTL_2, 0},
{
}
-static void evergreen_set_clip_state(struct pipe_context *ctx,
- const struct pipe_clip_state *state)
-{
- struct r600_context *rctx = (struct r600_context *)ctx;
- struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
-
- if (rstate == NULL)
- return;
-
- rctx->clip = *state;
- rstate->id = R600_PIPE_STATE_CLIP;
- for (int i = 0; i < 6; i++) {
- r600_pipe_state_add_reg(rstate,
- R_0285BC_PA_CL_UCP_0_X + i * 16,
- fui(state->ucp[i][0]), NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_0285C0_PA_CL_UCP_0_Y + i * 16,
- fui(state->ucp[i][1]) , NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_0285C4_PA_CL_UCP_0_Z + i * 16,
- fui(state->ucp[i][2]), NULL, 0);
- r600_pipe_state_add_reg(rstate,
- R_0285C8_PA_CL_UCP_0_W + i * 16,
- fui(state->ucp[i][3]), NULL, 0);
- }
-
- free(rctx->states[R600_PIPE_STATE_CLIP]);
- rctx->states[R600_PIPE_STATE_CLIP] = rstate;
- r600_context_pipe_state_set(rctx, rstate);
-}
-
static void evergreen_set_polygon_stipple(struct pipe_context *ctx,
const struct pipe_poly_stipple *state)
{
rctx->context.delete_sampler_state = si_delete_sampler_state;
rctx->context.delete_vertex_elements_state = r600_delete_vertex_element;
rctx->context.delete_vs_state = r600_delete_vs_shader;
- rctx->context.set_clip_state = evergreen_set_clip_state;
rctx->context.set_constant_buffer = r600_set_constant_buffer;
rctx->context.set_fragment_sampler_views = evergreen_set_ps_sampler_view;
rctx->context.set_framebuffer_state = evergreen_set_framebuffer_state;
enum r600_pipe_state_id {
R600_PIPE_STATE_CONFIG,
R600_PIPE_STATE_SEAMLESS_CUBEMAP,
- R600_PIPE_STATE_CLIP,
R600_PIPE_STATE_SCISSOR,
R600_PIPE_STATE_VIEWPORT,
R600_PIPE_STATE_RASTERIZER,
/* for saving when using blitter */
struct pipe_stencil_ref stencil_ref;
struct pipe_viewport_state viewport;
- struct pipe_clip_state clip;
struct r600_pipe_state config;
struct si_pipe_shader *ps_shader;
struct si_pipe_shader *vs_shader;
si_pm4_set_state(rctx, blend_color, pm4);
}
+static void si_set_clip_state(struct pipe_context *ctx,
+ const struct pipe_clip_state *state)
+{
+ struct r600_context *rctx = (struct r600_context *)ctx;
+ struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
+
+ if (pm4 == NULL)
+ return;
+
+ for (int i = 0; i < 6; i++) {
+ si_pm4_set_reg(pm4, R_0285BC_PA_CL_UCP_0_X + i * 16,
+ fui(state->ucp[i][0]));
+ si_pm4_set_reg(pm4, R_0285C0_PA_CL_UCP_0_Y + i * 16,
+ fui(state->ucp[i][1]));
+ si_pm4_set_reg(pm4, R_0285C4_PA_CL_UCP_0_Z + i * 16,
+ fui(state->ucp[i][2]));
+ si_pm4_set_reg(pm4, R_0285C8_PA_CL_UCP_0_W + i * 16,
+ fui(state->ucp[i][3]));
+ }
+
+ si_pm4_set_state(rctx, clip, pm4);
+}
+
void si_init_state_functions(struct r600_context *rctx)
{
rctx->context.create_blend_state = si_create_blend_state;
rctx->context.bind_blend_state = si_bind_blend_state;
rctx->context.delete_blend_state = si_delete_blend_state;
rctx->context.set_blend_color = si_set_blend_color;
+
+ rctx->context.set_clip_state = si_set_clip_state;
}
struct {
struct si_state_blend *blend;
struct si_pm4_state *blend_color;
+ struct si_pm4_state *clip;
} named;
struct si_pm4_state *array[0];
};