summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_state_common.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-09-10 01:04:47 +0200
committerMarek Olšák <[email protected]>2012-09-13 20:18:44 +0200
commit48de30e760516c981d0902556c5055981ec51594 (patch)
treeaf2196e3476105a12a47130769faaa742bc3ebf3 /src/gallium/drivers/r600/r600_state_common.c
parent1bce17ee01fb2ad77e37a600c2cacda57d0067ef (diff)
r600g: consolidate set_sampler_views functions
Reviewed-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state_common.c')
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c22
1 files changed, 17 insertions, 5 deletions
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;