diff options
author | Marek Olšák <[email protected]> | 2015-07-12 15:52:44 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-07-23 00:59:23 +0200 |
commit | 85f5722f70075e7a93b7a6cc41abee1bc493f4e2 (patch) | |
tree | 99c4e4d2cea2f7b10d0a599c02f9561fde5db3d7 /src/gallium/auxiliary | |
parent | 5ef1782b9ff8aa06f5b7fdbc7ade3e80131d1fda (diff) |
gallium/util: use cso_set_samplers
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/postprocess/pp_colors.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/postprocess/pp_mlaa.c | 23 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_blit.c | 6 |
3 files changed, 20 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/postprocess/pp_colors.c b/src/gallium/auxiliary/postprocess/pp_colors.c index 247e4df72a4..e6ea0102eac 100644 --- a/src/gallium/auxiliary/postprocess/pp_colors.c +++ b/src/gallium/auxiliary/postprocess/pp_colors.c @@ -37,6 +37,7 @@ pp_nocolor(struct pp_queue_t *ppq, struct pipe_resource *in, { struct pp_program *p = ppq->p; + const struct pipe_sampler_state *samplers[] = {&p->sampler_point}; pp_filter_setup_in(p, in); pp_filter_setup_out(p, out); @@ -44,8 +45,7 @@ pp_nocolor(struct pp_queue_t *ppq, struct pipe_resource *in, pp_filter_set_fb(p); pp_filter_misc_state(p); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point); - cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT); + cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers); cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->view); cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]); diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c index 147d14de95d..024a24895c8 100644 --- a/src/gallium/auxiliary/postprocess/pp_mlaa.c +++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c @@ -141,8 +141,10 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in, p->pipe->clear(p->pipe, PIPE_CLEAR_STENCIL | PIPE_CLEAR_COLOR0, &p->clear_color, 0, 0); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point); - cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT); + { + const struct pipe_sampler_state *samplers[] = {&p->sampler_point}; + cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers); + } cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->view); cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]); /* offsetvs */ @@ -168,10 +170,11 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in, pp_filter_set_clear_fb(p); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->sampler_point); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 2, &p->sampler); - cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT); + { + const struct pipe_sampler_state *samplers[] = + {&p->sampler_point, &p->sampler_point, &p->sampler}; + cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 3, samplers); + } arr[0] = p->view; cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 3, arr); @@ -199,9 +202,11 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in, u_sampler_view_default_template(&v_tmp, in, in->format); arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point); - cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->sampler_point); - cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT); + { + const struct pipe_sampler_state *samplers[] = + {&p->sampler_point, &p->sampler_point}; + cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 2, samplers); + } arr[1] = p->view; cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 2, arr); diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index 70782a1aea9..9737c940936 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -572,8 +572,10 @@ util_blit_pixels_tex(struct blit_state *ctx, ctx->sampler.normalized_coords = normalized; ctx->sampler.min_img_filter = filter; ctx->sampler.mag_img_filter = filter; - cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler); - cso_single_sampler_done(ctx->cso, PIPE_SHADER_FRAGMENT); + { + const struct pipe_sampler_state *samplers[] = {&ctx->sampler}; + cso_set_samplers(ctx->cso, PIPE_SHADER_FRAGMENT, 1, samplers); + } /* viewport */ ctx->viewport.scale[0] = 0.5f * dst->width; |