summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-07-05 16:54:44 +0200
committerMarek Olšák <[email protected]>2015-07-23 00:59:23 +0200
commit5ef1782b9ff8aa06f5b7fdbc7ade3e80131d1fda (patch)
tree214ae3a1fcf2b8c7427e9becbeb700ed6eb8cb6f /src/mesa/state_tracker
parent4ef7d93a941257b18506eae056631e8f4a11f893 (diff)
st/mesa: use cso_set_samplers
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c9
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index b68eb16d7be..4ab82bc9acb 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -245,6 +245,7 @@ update_shader_samplers(struct st_context *st,
GLuint unit;
GLbitfield samplers_used;
const GLuint old_max = *num_samplers;
+ const struct pipe_sampler_state *states[PIPE_MAX_SAMPLERS];
samplers_used = prog->SamplersUsed;
@@ -261,13 +262,11 @@ update_shader_samplers(struct st_context *st,
const GLuint texUnit = prog->SamplerUnits[unit];
convert_sampler(st, sampler, texUnit);
-
+ states[unit] = sampler;
*num_samplers = unit + 1;
-
- cso_single_sampler(st->cso_context, shader_stage, unit, sampler);
}
else if (samplers_used != 0 || unit < old_max) {
- cso_single_sampler(st->cso_context, shader_stage, unit, NULL);
+ states[unit] = NULL;
}
else {
/* if we've reset all the old samplers and we have no more new ones */
@@ -275,7 +274,7 @@ update_shader_samplers(struct st_context *st,
}
}
- cso_single_sampler_done(st->cso_context, shader_stage);
+ cso_set_samplers(st->cso_context, shader_stage, *num_samplers, states);
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index f67f00d504f..b372697026b 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -757,6 +757,8 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
/* texture sampling state: */
{
struct pipe_sampler_state sampler;
+ const struct pipe_sampler_state *states[2] = {&sampler, &sampler};
+
memset(&sampler, 0, sizeof(sampler));
sampler.wrap_s = PIPE_TEX_WRAP_CLAMP;
sampler.wrap_t = PIPE_TEX_WRAP_CLAMP;
@@ -766,11 +768,8 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
sampler.normalized_coords = normalized;
- cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, 0, &sampler);
- if (num_sampler_view > 1) {
- cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, 1, &sampler);
- }
- cso_single_sampler_done(cso, PIPE_SHADER_FRAGMENT);
+ cso_set_samplers(cso, PIPE_SHADER_FRAGMENT,
+ num_sampler_view > 1 ? 2 : 1, states);
}
/* viewport state: viewport matching window dims */