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/nouveau/nvc0 | |
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/nouveau/nvc0')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index e0e6e135258..4b8632a33d7 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -588,30 +588,6 @@ nvc0_stage_set_sampler_views(struct nvc0_context *nvc0, int s, } static void -nvc0_vp_set_sampler_views(struct pipe_context *pipe, - unsigned nr, - struct pipe_sampler_view **views) -{ - nvc0_stage_set_sampler_views(nvc0_context(pipe), 0, nr, views); -} - -static void -nvc0_fp_set_sampler_views(struct pipe_context *pipe, - unsigned nr, - struct pipe_sampler_view **views) -{ - nvc0_stage_set_sampler_views(nvc0_context(pipe), 4, nr, views); -} - -static void -nvc0_gp_set_sampler_views(struct pipe_context *pipe, - unsigned nr, - struct pipe_sampler_view **views) -{ - nvc0_stage_set_sampler_views(nvc0_context(pipe), 3, nr, views); -} - -static void nvc0_stage_set_sampler_views_range(struct nvc0_context *nvc0, const unsigned s, unsigned start, unsigned nr, struct pipe_sampler_view **views) @@ -662,13 +638,29 @@ nvc0_stage_set_sampler_views_range(struct nvc0_context *nvc0, const unsigned s, } static void -nvc0_cp_set_sampler_views(struct pipe_context *pipe, - unsigned start, unsigned nr, - struct pipe_sampler_view **views) +nvc0_set_sampler_views(struct pipe_context *pipe, unsigned shader, + unsigned start, unsigned nr, + struct pipe_sampler_view **views) { - nvc0_stage_set_sampler_views_range(nvc0_context(pipe), 5, start, nr, views); - - nvc0_context(pipe)->dirty_cp |= NVC0_NEW_CP_TEXTURES; + assert(start == 0); + switch (shader) { + case PIPE_SHADER_VERTEX: + nvc0_stage_set_sampler_views(nvc0_context(pipe), 0, nr, views); + break; + case PIPE_SHADER_GEOMETRY: + nvc0_stage_set_sampler_views(nvc0_context(pipe), 3, nr, views); + break; + case PIPE_SHADER_FRAGMENT: + nvc0_stage_set_sampler_views(nvc0_context(pipe), 4, nr, views); + break; + case PIPE_SHADER_COMPUTE: + nvc0_stage_set_sampler_views_range(nvc0_context(pipe), 5, + start, nr, views); + nvc0_context(pipe)->dirty_cp |= NVC0_NEW_CP_TEXTURES; + break; + default: + ; + } } @@ -1197,10 +1189,7 @@ nvc0_init_state_functions(struct nvc0_context *nvc0) pipe->create_sampler_view = nvc0_create_sampler_view; pipe->sampler_view_destroy = nvc0_sampler_view_destroy; - pipe->set_vertex_sampler_views = nvc0_vp_set_sampler_views; - pipe->set_fragment_sampler_views = nvc0_fp_set_sampler_views; - pipe->set_geometry_sampler_views = nvc0_gp_set_sampler_views; - pipe->set_compute_sampler_views = nvc0_cp_set_sampler_views; + pipe->set_sampler_views = nvc0_set_sampler_views; pipe->create_vs_state = nvc0_vp_state_create; pipe->create_fs_state = nvc0_fp_state_create; |