-enum pipe_error
+void
cso_single_sampler(struct cso_context *ctx, enum pipe_shader_type shader_stage,
unsigned idx, const struct pipe_sampler_state *templ)
{
if (cso_hash_iter_is_null(iter)) {
cso = MALLOC(sizeof(struct cso_sampler));
if (!cso)
- return PIPE_ERROR_OUT_OF_MEMORY;
+ return;
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
if (cso_hash_iter_is_null(iter)) {
FREE(cso);
- return PIPE_ERROR_OUT_OF_MEMORY;
+ return;
}
}
else {
ctx->samplers[shader_stage].samplers[idx] = cso->data;
ctx->max_sampler_seen = MAX2(ctx->max_sampler_seen, (int)idx);
}
-
- return PIPE_OK;
}
* last one. Done to always try to set as many samplers
* as possible.
*/
-enum pipe_error
+void
cso_set_samplers(struct cso_context *ctx,
enum pipe_shader_type shader_stage,
unsigned nr,
const struct pipe_sampler_state **templates)
{
- unsigned i;
- enum pipe_error temp, error = PIPE_OK;
-
- for (i = 0; i < nr; i++) {
- temp = cso_single_sampler(ctx, shader_stage, i, templates[i]);
- if (temp != PIPE_OK)
- error = temp;
- }
+ for (unsigned i = 0; i < nr; i++)
+ cso_single_sampler(ctx, shader_stage, i, templates[i]);
cso_single_sampler_done(ctx, shader_stage);
-
- return error;
}
static void
const struct pipe_rasterizer_state *rasterizer );
-enum pipe_error
+void
cso_set_samplers(struct cso_context *cso,
enum pipe_shader_type shader_stage,
unsigned count,
/* Alternate interface to support state trackers that like to modify
* samplers one at a time:
*/
-enum pipe_error
+void
cso_single_sampler(struct cso_context *cso, enum pipe_shader_type shader_stage,
unsigned idx, const struct pipe_sampler_state *states);