summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-10-07 18:16:22 -0600
committerBrian Paul <[email protected]>2013-10-23 10:15:38 -0600
commita3ed98f7aa85636579a5696bf036ec13e5c9104a (patch)
tree104078a2a8b875e5ec7c5524e7797d46d109d7e0 /src/gallium/drivers/radeonsi
parentb11fc226e6b106de8eb777a8e62c4f7303c66fbc (diff)
gallium: new, unified pipe_context::set_sampler_views() function
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c30
1 files changed, 10 insertions, 20 deletions
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;