diff options
author | Jerome Glisse <[email protected]> | 2010-08-24 17:46:31 -0400 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2010-08-25 17:41:50 -0400 |
commit | bd25e23bf3740f59ce8859848c715daeb9e9821f (patch) | |
tree | a5a3aee080ec3dbf75a85aa1a5eafae538465c5b /src/gallium/drivers/r600/r600_shader.c | |
parent | b5c07b9226d8e7de78f6367b5799b39caf820ef3 (diff) |
r600g: simplify states
Directly build PM4 packet, avoid using malloc (no states are
bigger than 128 dwords), remove unecessary informations,
remove pm4 building in favor of prebuild pm4 packet.
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index b2d1a1bf016..f0b7df5a6f3 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -132,7 +132,7 @@ static int r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_context_sta unsigned i, tmp; rpshader->rstate = radeon_state_decref(rpshader->rstate); - state = radeon_state(rscreen->rw, R600_VS_SHADER_TYPE, R600_VS_SHADER); + state = radeon_state(rscreen->rw, R600_VS_SHADER); if (state == NULL) return -ENOMEM; for (i = 0; i < 10; i++) { @@ -151,6 +151,8 @@ static int r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_context_sta rpshader->rstate->nbo = 2; rpshader->rstate->placement[0] = RADEON_GEM_DOMAIN_GTT; rpshader->rstate->placement[2] = RADEON_GEM_DOMAIN_GTT; + state->reloc_pm4_id[0] = R600_VS_SHADER__SQ_PGM_START_VS_BO_ID; + state->reloc_pm4_id[1] = R600_VS_SHADER__SQ_PGM_START_FS_BO_ID; return radeon_state_pm4(state); } @@ -165,7 +167,7 @@ static int r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_context_sta rasterizer = &rctx->rasterizer->state.rasterizer; rpshader->rstate = radeon_state_decref(rpshader->rstate); - state = radeon_state(rscreen->rw, R600_PS_SHADER_TYPE, R600_PS_SHADER); + state = radeon_state(rscreen->rw, R600_PS_SHADER); if (state == NULL) return -ENOMEM; for (i = 0; i < rshader->ninput; i++) { @@ -204,6 +206,7 @@ static int r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_context_sta rpshader->rstate->bo[0] = radeon_bo_incref(rscreen->rw, rpshader->bo); rpshader->rstate->nbo = 1; rpshader->rstate->placement[0] = RADEON_GEM_DOMAIN_GTT; + state->reloc_pm4_id[0] = R600_PS_SHADER__SQ_PGM_START_PS_BO_ID; return radeon_state_pm4(state); } |