/* * If the function encouters any errors it will return the * last one. Done to always try to set as many samplers * as possible. */ enum pipe_error cso_set_samplers(struct cso_context *ctx, unsigned shader_stage, unsigned nr, const struct pipe_sampler_state **templates) { struct sampler_info *info = &ctx->samplers[shader_stage]; unsigned i; enum pipe_error temp, error = PIPE_OK; /* TODO: fastpath */ for (i = 0; i < nr; i++) { temp = single_sampler(ctx, info, i, templates[i]); if (temp != PIPE_OK) error = temp; } for ( ; i < info->nr_samplers; i++) { temp = single_sampler(ctx, info, i, NULL); if (temp != PIPE_OK) error = temp; } single_sampler_done(ctx, shader_stage); return error; }
enum pipe_error cso_single_sampler(struct cso_context *ctx, unsigned idx, const struct pipe_sampler_state *templ) { return single_sampler(ctx, &ctx->fragment_samplers, idx, templ); }
enum pipe_error cso_single_sampler(struct cso_context *ctx, unsigned shader_stage, unsigned idx, const struct pipe_sampler_state *templ) { return single_sampler(ctx, &ctx->samplers[shader_stage], idx, templ); }