r600g: consolidate set_sampler_views functions
authorMarek Olšák <maraeo@gmail.com>
Sun, 9 Sep 2012 23:04:47 +0000 (01:04 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 13 Sep 2012 18:18:44 +0000 (20:18 +0200)
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c

index baeedaeeed70e43a4bff818f2a9e825dbd016791..c8a2c35edc2c884442b8590c8efeaa58373c216d 100644 (file)
@@ -1122,18 +1122,6 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
        return &view->base;
 }
 
-static void evergreen_set_vs_sampler_views(struct pipe_context *ctx, unsigned count,
-                                          struct pipe_sampler_view **views)
-{
-       r600_set_sampler_views(ctx, PIPE_SHADER_VERTEX, 0, count, views);
-}
-
-static void evergreen_set_ps_sampler_views(struct pipe_context *ctx, unsigned count,
-                                          struct pipe_sampler_view **views)
-{
-       r600_set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, count, views);
-}
-
 static void evergreen_set_clip_state(struct pipe_context *ctx,
                                const struct pipe_clip_state *state)
 {
@@ -2215,11 +2203,9 @@ void evergreen_init_state_functions(struct r600_context *rctx)
        rctx->context.create_sampler_state = evergreen_create_sampler_state;
        rctx->context.create_sampler_view = evergreen_create_sampler_view;
        rctx->context.set_clip_state = evergreen_set_clip_state;
-       rctx->context.set_fragment_sampler_views = evergreen_set_ps_sampler_views;
        rctx->context.set_framebuffer_state = evergreen_set_framebuffer_state;
        rctx->context.set_polygon_stipple = evergreen_set_polygon_stipple;
        rctx->context.set_scissor_state = evergreen_set_scissor_state;
-       rctx->context.set_vertex_sampler_views = evergreen_set_vs_sampler_views;
        rctx->context.set_viewport_state = evergreen_set_viewport_state;
        evergreen_init_compute_state_functions(rctx);
 }
index 57861358b3557a6e7ed43452c403639b4912c16d..5966cefb75a0c495d85433a7a5f2a845e3a78da3 100644 (file)
@@ -571,11 +571,6 @@ void r600_init_atom(struct r600_context *rctx, struct r600_atom *atom, unsigned
 void r600_vertex_buffers_dirty(struct r600_context *rctx);
 void r600_sampler_views_dirty(struct r600_context *rctx,
                              struct r600_samplerview_state *state);
-void r600_set_sampler_views(struct pipe_context *pipe,
-                            unsigned shader,
-                            unsigned start,
-                           unsigned count,
-                           struct pipe_sampler_view **views);
 void r600_set_max_scissor(struct r600_context *rctx);
 void r600_constant_buffers_dirty(struct r600_context *rctx, struct r600_constbuf_state *state);
 void r600_draw_rectangle(struct blitter_context *blitter,
index 9a9d8276102e2e69959a01c8beefb3f2c3765447..add0d7d2231e4da56edb124ecc293ef95af82f9a 100644 (file)
@@ -1120,18 +1120,6 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
        return &view->base;
 }
 
-static void r600_set_vs_sampler_views(struct pipe_context *ctx, unsigned count,
-                                     struct pipe_sampler_view **views)
-{
-       r600_set_sampler_views(ctx, PIPE_SHADER_VERTEX, 0, count, views);
-}
-
-static void r600_set_ps_sampler_views(struct pipe_context *ctx, unsigned count,
-                                     struct pipe_sampler_view **views)
-{
-       r600_set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, count, views);
-}
-
 static void r600_set_clip_state(struct pipe_context *ctx,
                                const struct pipe_clip_state *state)
 {
@@ -2089,11 +2077,9 @@ void r600_init_state_functions(struct r600_context *rctx)
        rctx->context.create_sampler_state = r600_create_sampler_state;
        rctx->context.create_sampler_view = r600_create_sampler_view;
        rctx->context.set_clip_state = r600_set_clip_state;
-       rctx->context.set_fragment_sampler_views = r600_set_ps_sampler_views;
        rctx->context.set_framebuffer_state = r600_set_framebuffer_state;
        rctx->context.set_polygon_stipple = r600_set_polygon_stipple;
        rctx->context.set_scissor_state = r600_pipe_set_scissor_state;
-       rctx->context.set_vertex_sampler_views = r600_set_vs_sampler_views;
        rctx->context.set_viewport_state = r600_set_viewport_state;
 }
 
index 28972274b0cd7df78b59d5fd67072c15ff8420cb..fd67d405da3c2ae6cb4400aa41ae40c8b43a4b50 100644 (file)
@@ -533,11 +533,9 @@ void r600_sampler_views_dirty(struct r600_context *rctx,
        }
 }
 
-void r600_set_sampler_views(struct pipe_context *pipe,
-                           unsigned shader,
-                           unsigned start,
-                           unsigned count,
-                           struct pipe_sampler_view **views)
+static void r600_set_sampler_views(struct pipe_context *pipe, unsigned shader,
+                                  unsigned start, unsigned count,
+                                  struct pipe_sampler_view **views)
 {
        struct r600_context *rctx = (struct r600_context *) pipe;
        struct r600_textures_info *dst;
@@ -622,6 +620,18 @@ void r600_set_sampler_views(struct pipe_context *pipe,
        r600_sampler_views_dirty(rctx, &dst->views);
 }
 
+static void r600_set_vs_sampler_views(struct pipe_context *ctx, unsigned count,
+                                     struct pipe_sampler_view **views)
+{
+       r600_set_sampler_views(ctx, PIPE_SHADER_VERTEX, 0, count, views);
+}
+
+static void r600_set_ps_sampler_views(struct pipe_context *ctx, unsigned count,
+                                     struct pipe_sampler_view **views)
+{
+       r600_set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, count, views);
+}
+
 static void *r600_create_vertex_elements(struct pipe_context *ctx, unsigned count,
                                         const struct pipe_vertex_element *elements)
 {
@@ -1473,6 +1483,8 @@ void r600_init_common_state_functions(struct r600_context *rctx)
        rctx->context.set_stencil_ref = r600_set_pipe_stencil_ref;
        rctx->context.set_vertex_buffers = r600_set_vertex_buffers;
        rctx->context.set_index_buffer = r600_set_index_buffer;
+       rctx->context.set_fragment_sampler_views = r600_set_ps_sampler_views;
+       rctx->context.set_vertex_sampler_views = r600_set_vs_sampler_views;
        rctx->context.sampler_view_destroy = r600_sampler_view_destroy;
        rctx->context.texture_barrier = r600_texture_barrier;
        rctx->context.create_stream_output_target = r600_create_so_target;