summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-06-02 14:57:13 +1000
committerDave Airlie <[email protected]>2011-06-02 14:59:29 +1000
commit4423c79ddf6853d1d4594afda3e1262c1b9af4f5 (patch)
treec708d3df8dd6369ddd4fc3623050e3b7fd41f042 /src/gallium/winsys
parent42502b6f03230b828121f60143190c39bc5c8dda (diff)
r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time, it also allows the compiler to use constants for a lot of things instead of working them out each time. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index 6415268c786..a3c8945a722 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -940,7 +940,6 @@ void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block
void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_state *state)
{
- struct r600_range *range;
struct r600_block *block;
unsigned new_val;
int dirty;
@@ -948,9 +947,8 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat
unsigned id, reloc_id;
struct r600_pipe_reg *reg = &state->regs[i];
- range = &ctx->range[CTX_RANGE_ID(reg->offset)];
- block = range->blocks[CTX_BLOCK_ID(reg->offset)];
- id = (reg->offset - block->start_offset) >> 2;
+ block = reg->block;
+ id = reg->id;
dirty = block->status & R600_BLOCK_STATUS_DIRTY;