GLuint unit;
GLbitfield samplers_used;
const GLuint old_max = *num_samplers;
+ const struct pipe_sampler_state *states[PIPE_MAX_SAMPLERS];
samplers_used = prog->SamplersUsed;
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 */
}
}
- cso_single_sampler_done(st->cso_context, shader_stage);
+ cso_set_samplers(st->cso_context, shader_stage, *num_samplers, states);
}
/* 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;
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 */