- ctx->pipe->bind_fragment_sampler_states( ctx->pipe, 0, NULL );
- if (ctx->pipe->bind_vertex_sampler_states)
- ctx->pipe->bind_vertex_sampler_states(ctx->pipe, 0, NULL);
+
+ {
+ static struct pipe_sampler_view *views[PIPE_MAX_SAMPLERS] = { NULL };
+ static void *zeros[PIPE_MAX_SAMPLERS] = { NULL };
+ struct pipe_screen *scr = ctx->pipe->screen;
+ unsigned sh;
+ for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) {
+ int max = scr->get_shader_param(scr, sh,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
+ assert(max <= PIPE_MAX_SAMPLERS);
+ if (max > 0) {
+ ctx->pipe->bind_sampler_states(ctx->pipe, sh, 0, max, zeros);
+ ctx->pipe->set_sampler_views(ctx->pipe, sh, 0, max, views);
+ }
+ }
+ }
+