r600g: remove duplicated set_xx_resource functions
authorMarek Olšák <maraeo@gmail.com>
Tue, 21 Feb 2012 18:47:07 +0000 (19:47 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 23 Feb 2012 19:29:56 +0000 (20:29 +0100)
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/evergreen_hw_context.c
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600.h
src/gallium/drivers/r600/r600_state_common.c

index bf6f422c671f52f1b848aad7353f254d5cc3e69c..a5474754552d059348236e6932c81f6495c5f490 100644 (file)
@@ -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;
index c4da360547e5710fb772c75dad8ff84b49fcfd7d..4eca42c22bee15221bcbd73c2713f2c8379abb50 100644 (file)
@@ -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);
                }
        }
index a792e94b06ba65107d17b4ae0051cc1c12b1ea87..deba53f6ac83ff00b06e018b9bbb3bc93e2fcced 100644 (file)
@@ -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);
 
index cadb07943c42b8dac1f831c29f03ae1dcc3482b0..ec030de1cec57f6804c9a4ee14a0a6ffb7711f4d 100644 (file)
@@ -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);
        }
 }