/**************** fragment/vertex sampler view state *************************/
-static enum pipe_error
-single_sampler(struct cso_context *ctx,
- struct sampler_info *info,
- unsigned idx,
- const struct pipe_sampler_state *templ)
+enum pipe_error
+cso_single_sampler(struct cso_context *ctx, unsigned shader_stage,
+ unsigned idx, const struct pipe_sampler_state *templ)
{
void *handle = NULL;
}
}
- info->samplers[idx] = handle;
-
+ ctx->samplers[shader_stage].samplers[idx] = handle;
return PIPE_OK;
}
-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);
-}
-
-
-static void
-single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
+void
+cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
info->samplers);
}
-void
-cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
-{
- single_sampler_done(ctx, shader_stage);
-}
-
/*
* If the function encouters any errors it will return the
*/
for (i = 0; i < nr; i++) {
- temp = single_sampler(ctx, info, i, templates[i]);
+ temp = cso_single_sampler(ctx, shader_stage, i, templates[i]);
if (temp != PIPE_OK)
error = temp;
}
for ( ; i < info->nr_samplers; i++) {
- temp = single_sampler(ctx, info, i, NULL);
+ temp = cso_single_sampler(ctx, shader_stage, i, NULL);
if (temp != PIPE_OK)
error = temp;
}
- single_sampler_done(ctx, shader_stage);
+ cso_single_sampler_done(ctx, shader_stage);
return error;
}
info->nr_samplers = ctx->nr_fragment_samplers_saved;
memcpy(info->samplers, ctx->fragment_samplers_saved,
sizeof(info->samplers));
- single_sampler_done(ctx, PIPE_SHADER_FRAGMENT);
+ cso_single_sampler_done(ctx, PIPE_SHADER_FRAGMENT);
}