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/galahad/glhd_context.c | |
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/galahad/glhd_context.c')
-rw-r--r-- | src/gallium/drivers/galahad/glhd_context.c | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index dc3d5f056df..0bb7abd3ac0 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -519,58 +519,12 @@ galahad_context_set_sampler_views(struct pipe_context *_pipe, struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS]; - struct pipe_sampler_view **views = NULL; unsigned i; - if (_views) { - for (i = 0; i < num; i++) - unwrapped_views[i] = galahad_sampler_view_unwrap(_views[i]); - for (; i < PIPE_MAX_SAMPLERS; i++) - unwrapped_views[i] = NULL; + for (i = 0; i < num; i++) + unwrapped_views[i] = galahad_sampler_view_unwrap(_views[i]); - views = unwrapped_views; - } - - switch (shader) { - case PIPE_SHADER_VERTEX: - pipe->set_vertex_sampler_views(pipe, num, views); - break; - case PIPE_SHADER_FRAGMENT: - pipe->set_fragment_sampler_views(pipe, num, views); - break; - case PIPE_SHADER_GEOMETRY: - pipe->set_geometry_sampler_views(pipe, num, views); - break; - default: - assert(0); - } -} - -static void -galahad_context_set_vertex_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_VERTEX, - 0, num, _views); -} - -static void -galahad_context_set_fragment_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_FRAGMENT, - 0, num, _views); -} - -static void -galahad_context_set_geometry_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_GEOMETRY, - 0, num, _views); + pipe->set_sampler_views(pipe, shader, start, num, unwrapped_views); } static void @@ -1053,10 +1007,7 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) GLHD_PIPE_INIT(set_polygon_stipple); GLHD_PIPE_INIT(set_scissor_states); GLHD_PIPE_INIT(set_viewport_states); - GLHD_PIPE_INIT(set_fragment_sampler_views); - GLHD_PIPE_INIT(set_vertex_sampler_views); - GLHD_PIPE_INIT(set_geometry_sampler_views); - //GLHD_PIPE_INIT(set_compute_sampler_views); + GLHD_PIPE_INIT(set_sampler_views); //GLHD_PIPE_INIT(set_shader_resources); GLHD_PIPE_INIT(set_vertex_buffers); GLHD_PIPE_INIT(set_index_buffer); |