From 48de30e760516c981d0902556c5055981ec51594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 10 Sep 2012 01:04:47 +0200 Subject: [PATCH] r600g: consolidate set_sampler_views functions Reviewed-by: Jerome Glisse --- src/gallium/drivers/r600/evergreen_state.c | 14 ------------- src/gallium/drivers/r600/r600_pipe.h | 5 ----- src/gallium/drivers/r600/r600_state.c | 14 ------------- src/gallium/drivers/r600/r600_state_common.c | 22 +++++++++++++++----- 4 files changed, 17 insertions(+), 38 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index baeedaeeed7..c8a2c35edc2 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -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); } diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 57861358b35..5966cefb75a 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -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, diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 9a9d8276102..add0d7d2231 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -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; } diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 28972274b0c..fd67d405da3 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -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; -- 2.30.2