diff options
author | Brian Paul <[email protected]> | 2013-10-07 18:16:22 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-10-23 10:15:38 -0600 |
commit | a3ed98f7aa85636579a5696bf036ec13e5c9104a (patch) | |
tree | 104078a2a8b875e5ec7c5524e7797d46d109d7e0 /src/gallium/drivers/i915 | |
parent | b11fc226e6b106de8eb777a8e62c4f7303c66fbc (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/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_state.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index f722e2dcfeb..54c343cf2bf 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -793,6 +793,25 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe, } +static void +i915_set_sampler_views(struct pipe_context *pipe, unsigned shader, + unsigned start, unsigned num, + struct pipe_sampler_view **views) +{ + assert(start == 0); + switch (shader) { + case PIPE_SHADER_FRAGMENT: + i915_set_fragment_sampler_views(pipe, num, views); + break; + case PIPE_SHADER_VERTEX: + i915_set_vertex_sampler_views(pipe, num, views); + break; + default: + ; + } +} + + static struct pipe_sampler_view * i915_create_sampler_view(struct pipe_context *pipe, struct pipe_resource *texture, @@ -1076,8 +1095,7 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.set_polygon_stipple = i915_set_polygon_stipple; i915->base.set_scissor_states = i915_set_scissor_states; - i915->base.set_fragment_sampler_views = i915_set_fragment_sampler_views; - i915->base.set_vertex_sampler_views = i915_set_vertex_sampler_views; + i915->base.set_sampler_views = i915_set_sampler_views; i915->base.create_sampler_view = i915_create_sampler_view; i915->base.sampler_view_destroy = i915_sampler_view_destroy; i915->base.set_viewport_states = i915_set_viewport_states; |