From a3ed98f7aa85636579a5696bf036ec13e5c9104a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Oct 2013 18:16:22 -0600 Subject: gallium: new, unified pipe_context::set_sampler_views() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new function replaces four old functions: set_fragment/vertex/ geometry/compute_sampler_views(). Note: at this time, it's expected that the 'start' parameter will always be zero. Reviewed-by: Roland Scheidegger Reviewed-by: Marek Olšák Tested-by: Emil Velikov --- src/gallium/drivers/radeonsi/si_state.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/gallium/drivers/radeonsi') diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index da7c3d0ab0c..97710f01e7a 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2608,14 +2608,21 @@ static void *si_create_sampler_state(struct pipe_context *ctx, /* XXX consider moving this function to si_descriptors.c for gcc to inline * the si_set_sampler_view calls. LTO might help too. */ -static void si_set_sampler_views(struct r600_context *rctx, - unsigned shader, unsigned count, +static void si_set_sampler_views(struct pipe_context *ctx, + unsigned shader, unsigned start, + unsigned count, struct pipe_sampler_view **views) { + struct r600_context *rctx = (struct r600_context *)ctx; struct r600_textures_info *samplers = &rctx->samplers[shader]; struct si_pipe_sampler_view **rviews = (struct si_pipe_sampler_view **)views; int i; + if (shader != PIPE_SHADER_VERTEX && shader != PIPE_SHADER_FRAGMENT) + return; + + assert(start == 0); + for (i = 0; i < count; i++) { if (views[i]) { struct r600_texture *rtex = @@ -2661,22 +2668,6 @@ static void si_set_sampler_views(struct r600_context *rctx, rctx->b.flags |= R600_CONTEXT_INV_TEX_CACHE; } -static void si_set_vs_sampler_views(struct pipe_context *ctx, unsigned count, - struct pipe_sampler_view **views) -{ - struct r600_context *rctx = (struct r600_context *)ctx; - - si_set_sampler_views(rctx, PIPE_SHADER_VERTEX, count, views); -} - -static void si_set_ps_sampler_views(struct pipe_context *ctx, unsigned count, - struct pipe_sampler_view **views) -{ - struct r600_context *rctx = (struct r600_context *)ctx; - - si_set_sampler_views(rctx, PIPE_SHADER_FRAGMENT, count, views); -} - static struct si_pm4_state *si_set_sampler_states(struct r600_context *rctx, unsigned count, void **states, struct r600_textures_info *samplers, @@ -3033,8 +3024,7 @@ void si_init_state_functions(struct r600_context *rctx) rctx->b.b.delete_sampler_state = si_delete_sampler_state; rctx->b.b.create_sampler_view = si_create_sampler_view; - rctx->b.b.set_vertex_sampler_views = si_set_vs_sampler_views; - rctx->b.b.set_fragment_sampler_views = si_set_ps_sampler_views; + rctx->b.b.set_sampler_views = si_set_sampler_views; rctx->b.b.sampler_view_destroy = si_sampler_view_destroy; rctx->b.b.set_sample_mask = si_set_sample_mask; -- cgit v1.2.3