summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/evergreen_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-10-05 04:02:22 +0200
committerMarek Olšák <[email protected]>2012-10-10 00:16:38 +0200
commita50edc8ed84c4c48c0dc8e1a079e8d5e8f1c3a0e (patch)
tree726615b19ce15b30522767c1911e7c2760ebf970 /src/gallium/drivers/r600/evergreen_state.c
parent8bf7044ec6ab041ebeb1db9ebe378f8e1f455f4e (diff)
r600g: atomize fetch shader
The state object is actually a buffer, it's literally a buffer containing the shader code. Reviewed-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 9aef66bfc28..d2bbc5be94b 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -2309,6 +2309,18 @@ static void cayman_emit_sample_mask(struct r600_context *rctx, struct r600_atom
r600_write_value(cs, mask | (mask << 16)); /* X0Y1_X1Y1 */
}
+static void evergreen_emit_vertex_fetch_shader(struct r600_context *rctx, struct r600_atom *a)
+{
+ struct radeon_winsys_cs *cs = rctx->cs;
+ struct r600_cso_state *state = (struct r600_cso_state*)a;
+ struct r600_resource *shader = (struct r600_resource*)state->cso;
+
+ r600_write_context_reg(cs, R_0288A4_SQ_PGM_START_FS,
+ r600_resource_va(rctx->context.screen, &shader->b.b) >> 8);
+ r600_write_value(cs, PKT3(PKT3_NOP, 0, 0));
+ r600_write_value(cs, r600_context_bo_reloc(rctx, shader, RADEON_USAGE_READ));
+}
+
void evergreen_init_state_functions(struct r600_context *rctx)
{
unsigned id = 4;
@@ -2360,6 +2372,7 @@ void evergreen_init_state_functions(struct r600_context *rctx)
r600_init_atom(rctx, &rctx->db_misc_state.atom, id++, evergreen_emit_db_misc_state, 7);
r600_init_atom(rctx, &rctx->stencil_ref.atom, id++, r600_emit_stencil_ref, 4);
r600_init_atom(rctx, &rctx->viewport.atom, id++, r600_emit_viewport_state, 8);
+ r600_init_atom(rctx, &rctx->vertex_fetch_shader.atom, id++, evergreen_emit_vertex_fetch_shader, 5);
rctx->context.create_blend_state = evergreen_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = evergreen_create_dsa_state;
@@ -3323,18 +3336,6 @@ void evergreen_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader
S_02881C_USE_VTX_POINT_SIZE(rshader->vs_out_point_size);
}
-void evergreen_fetch_shader(struct pipe_context *ctx,
- struct r600_vertex_element *ve)
-{
- struct r600_context *rctx = (struct r600_context *)ctx;
- struct r600_pipe_state *rstate = &ve->rstate;
- rstate->id = R600_PIPE_STATE_FETCH_SHADER;
- rstate->nregs = 0;
- r600_pipe_state_add_reg_bo(rstate, R_0288A4_SQ_PGM_START_FS,
- r600_resource_va(ctx->screen, (void *)ve->fetch_shader) >> 8,
- ve->fetch_shader, RADEON_USAGE_READ);
-}
-
void *evergreen_create_resolve_blend(struct r600_context *rctx)
{
struct pipe_blend_state blend;