diff options
author | Marek Olšák <[email protected]> | 2012-02-21 19:47:07 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-02-23 20:29:56 +0100 |
commit | edc0ce292b5a34ba1e2ef96c0b530fbf8428e67d (patch) | |
tree | e759c7747753f62896eb3bc764a86d45f480adf2 /src | |
parent | 985bd5487edc974f1ed7a9c50456478d959b51e2 (diff) |
r600g: remove duplicated set_xx_resource functions
Reviewed-by: Jerome Glisse <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_hw_context.c | 21 | ||||
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 21 |
4 files changed, 13 insertions, 48 deletions
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c index bf6f422c671..a5474754552 100644 --- a/src/gallium/drivers/r600/evergreen_hw_context.c +++ b/src/gallium/drivers/r600/evergreen_hw_context.c @@ -774,27 +774,6 @@ out_err: return r; } -void evergreen_context_pipe_state_set_ps_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid) -{ - struct r600_block *block = ctx->ps_resources.blocks[rid]; - - r600_context_pipe_state_set_resource(ctx, state, block); -} - -void evergreen_context_pipe_state_set_vs_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid) -{ - struct r600_block *block = ctx->vs_resources.blocks[rid]; - - r600_context_pipe_state_set_resource(ctx, state, block); -} - -void evergreen_context_pipe_state_set_fs_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid) -{ - struct r600_block *block = ctx->fs_resources.blocks[rid]; - - r600_context_pipe_state_set_resource(ctx, state, block); -} - static inline void evergreen_context_pipe_state_set_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset) { struct r600_range *range; diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index c4da360547e..4eca42c22be 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1061,8 +1061,8 @@ static void evergreen_set_vs_sampler_view(struct pipe_context *ctx, unsigned cou for (int i = 0; i < count; i++) { if (resource[i]) { - evergreen_context_pipe_state_set_vs_resource(rctx, &resource[i]->state, - i + R600_MAX_CONST_BUFFERS); + r600_context_pipe_state_set_vs_resource(rctx, &resource[i]->state, + i + R600_MAX_CONST_BUFFERS); } } } @@ -1080,11 +1080,11 @@ static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned cou if (resource[i]) { if (((struct r600_resource_texture *)resource[i]->base.texture)->depth) has_depth = 1; - evergreen_context_pipe_state_set_ps_resource(rctx, &resource[i]->state, - i + R600_MAX_CONST_BUFFERS); + r600_context_pipe_state_set_ps_resource(rctx, &resource[i]->state, + i + R600_MAX_CONST_BUFFERS); } else - evergreen_context_pipe_state_set_ps_resource(rctx, NULL, - i + R600_MAX_CONST_BUFFERS); + r600_context_pipe_state_set_ps_resource(rctx, NULL, + i + R600_MAX_CONST_BUFFERS); pipe_sampler_view_reference( (struct pipe_sampler_view **)&rctx->ps_samplers.views[i], @@ -1098,8 +1098,8 @@ static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned cou } for (i = count; i < NUM_TEX_UNITS; i++) { if (rctx->ps_samplers.views[i]) { - evergreen_context_pipe_state_set_ps_resource(rctx, NULL, - i + R600_MAX_CONST_BUFFERS); + r600_context_pipe_state_set_ps_resource(rctx, NULL, + i + R600_MAX_CONST_BUFFERS); pipe_sampler_view_reference((struct pipe_sampler_view **)&rctx->ps_samplers.views[i], NULL); } } diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index a792e94b06b..deba53f6ac8 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -235,9 +235,6 @@ void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block * void r600_context_block_resource_emit_dirty(struct r600_context *ctx, struct r600_block *block); int evergreen_context_init(struct r600_context *ctx); -void evergreen_context_pipe_state_set_ps_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid); -void evergreen_context_pipe_state_set_vs_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid); -void evergreen_context_pipe_state_set_fs_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid); void evergreen_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned id); void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned id); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index cadb07943c4..ec030de1cec 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -381,19 +381,11 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count, /* Zero states. */ for (i = 0; i < count; i++) { if (!buffers[i].buffer) { - if (rctx->chip_class >= EVERGREEN) { - evergreen_context_pipe_state_set_fs_resource(rctx, NULL, i); - } else { - r600_context_pipe_state_set_fs_resource(rctx, NULL, i); - } + r600_context_pipe_state_set_fs_resource(rctx, NULL, i); } } for (; i < rctx->vbuf_mgr->nr_real_vertex_buffers; i++) { - if (rctx->chip_class >= EVERGREEN) { - evergreen_context_pipe_state_set_fs_resource(rctx, NULL, i); - } else { - r600_context_pipe_state_set_fs_resource(rctx, NULL, i); - } + r600_context_pipe_state_set_fs_resource(rctx, NULL, i); } u_vbuf_set_vertex_buffers(rctx->vbuf_mgr, count, buffers); @@ -561,11 +553,10 @@ void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index, if (rctx->chip_class >= EVERGREEN) { evergreen_pipe_mod_buffer_resource(ctx, rstate, rbuffer, offset, 16, RADEON_USAGE_READ); - evergreen_context_pipe_state_set_vs_resource(rctx, rstate, index); } else { r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, 16, RADEON_USAGE_READ); - r600_context_pipe_state_set_vs_resource(rctx, rstate, index); } + r600_context_pipe_state_set_vs_resource(rctx, rstate, index); break; case PIPE_SHADER_FRAGMENT: rctx->ps_const_buffer.nregs = 0; @@ -588,11 +579,10 @@ void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index, } if (rctx->chip_class >= EVERGREEN) { evergreen_pipe_mod_buffer_resource(ctx, rstate, rbuffer, offset, 16, RADEON_USAGE_READ); - evergreen_context_pipe_state_set_ps_resource(rctx, rstate, index); } else { r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, 16, RADEON_USAGE_READ); - r600_context_pipe_state_set_ps_resource(rctx, rstate, index); } + r600_context_pipe_state_set_ps_resource(rctx, rstate, index); break; default: R600_ERR("unsupported %d\n", shader); @@ -715,11 +705,10 @@ static void r600_vertex_buffer_update(struct r600_context *rctx) if (rctx->chip_class >= EVERGREEN) { evergreen_pipe_mod_buffer_resource(&rctx->context, rstate, rbuffer, offset, vertex_buffer->stride, RADEON_USAGE_READ); - evergreen_context_pipe_state_set_fs_resource(rctx, rstate, i); } else { r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, vertex_buffer->stride, RADEON_USAGE_READ); - r600_context_pipe_state_set_fs_resource(rctx, rstate, i); } + r600_context_pipe_state_set_fs_resource(rctx, rstate, i); } } |