summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-12-09 18:51:31 +0100
committerMarek Olšák <[email protected]>2012-12-12 13:12:31 +0100
commitd225d076a9807083ea065462390981b9514b6cfc (patch)
treeae80bb230a75ded9f9cb731718c3bea2319f52c6 /src/gallium/drivers/r600/r600_state.c
parent8df3855eed67302e83e4b181c4fa02183ccc185a (diff)
r600g: suballocate memory for fetch shaders from a large buffer
Fetch shaders are usually destroyed at the context destruction by the state tracker, so we can put them all in a large buffer without wasting memory. This reduces the number of relocations sent to the kernel a little bit. Tested-by: Aaron Watry <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r--src/gallium/drivers/r600/r600_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index ab658da812a..9bfae4f2299 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -2117,11 +2117,11 @@ static void r600_emit_vertex_fetch_shader(struct r600_context *rctx, struct r600
{
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;
+ struct r600_fetch_shader *shader = (struct r600_fetch_shader*)state->cso;
- r600_write_context_reg(cs, R_028894_SQ_PGM_START_FS, 0);
+ r600_write_context_reg(cs, R_028894_SQ_PGM_START_FS, shader->offset >> 8);
r600_write_value(cs, PKT3(PKT3_NOP, 0, 0));
- r600_write_value(cs, r600_context_bo_reloc(rctx, shader, RADEON_USAGE_READ));
+ r600_write_value(cs, r600_context_bo_reloc(rctx, shader->buffer, RADEON_USAGE_READ));
}
void r600_init_state_functions(struct r600_context *rctx)