diff options
author | Brian Paul <brianp@vmware.com> | 2013-10-07 18:16:22 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2013-10-23 10:15:38 -0600 |
commit | a3ed98f7aa85636579a5696bf036ec13e5c9104a (patch) | |
tree | 104078a2a8b875e5ec7c5524e7797d46d109d7e0 /src/gallium/auxiliary/draw/draw_pipe_pstipple.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 <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index e39276a55d..17b1d3d703 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -103,7 +103,8 @@ struct pstip_stage unsigned, unsigned, void **); void (*driver_set_sampler_views)(struct pipe_context *, - unsigned, + unsigned shader, unsigned start, + unsigned count, struct pipe_sampler_view **); void (*driver_set_polygon_stipple)(struct pipe_context *, @@ -552,7 +553,9 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header) pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, num_samplers, pstip->state.samplers); - pstip->driver_set_sampler_views(pipe, num_samplers, pstip->state.sampler_views); + pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, + num_samplers, pstip->state.sampler_views); + draw->suspend_flushing = FALSE; /* now really draw first triangle */ @@ -579,9 +582,10 @@ pstip_flush(struct draw_stage *stage, unsigned flags) pstip->num_samplers, pstip->state.samplers); - pstip->driver_set_sampler_views(pipe, + pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, pstip->num_sampler_views, pstip->state.sampler_views); + draw->suspend_flushing = FALSE; } @@ -732,24 +736,23 @@ pstip_bind_sampler_states(struct pipe_context *pipe, unsigned shader, static void pstip_set_sampler_views(struct pipe_context *pipe, - unsigned num, + unsigned shader, unsigned start, unsigned num, struct pipe_sampler_view **views) { struct pstip_stage *pstip = pstip_stage_from_pipe(pipe); uint i; - /* save current */ - for (i = 0; i < num; i++) { - pipe_sampler_view_reference(&pstip->state.sampler_views[i], views[i]); - } - for (; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) { - pipe_sampler_view_reference(&pstip->state.sampler_views[i], NULL); + if (shader == PIPE_SHADER_FRAGMENT) { + /* save current */ + for (i = 0; i < num; i++) { + pipe_sampler_view_reference(&pstip->state.sampler_views[start + i], + views[i]); + } + pstip->num_sampler_views = num; } - pstip->num_sampler_views = num; - /* pass-through */ - pstip->driver_set_sampler_views(pstip->pipe, num, views); + pstip->driver_set_sampler_views(pstip->pipe, shader, start, num, views); } @@ -804,7 +807,7 @@ draw_install_pstipple_stage(struct draw_context *draw, pstip->driver_delete_fs_state = pipe->delete_fs_state; pstip->driver_bind_sampler_states = pipe->bind_sampler_states; - pstip->driver_set_sampler_views = pipe->set_fragment_sampler_views; + pstip->driver_set_sampler_views = pipe->set_sampler_views; pstip->driver_set_polygon_stipple = pipe->set_polygon_stipple; /* override the driver's functions */ @@ -813,7 +816,7 @@ draw_install_pstipple_stage(struct draw_context *draw, pipe->delete_fs_state = pstip_delete_fs_state; pipe->bind_sampler_states = pstip_bind_sampler_states; - pipe->set_fragment_sampler_views = pstip_set_sampler_views; + pipe->set_sampler_views = pstip_set_sampler_views; pipe->set_polygon_stipple = pstip_set_polygon_stipple; return TRUE; |