summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-07-05 16:57:58 +0200
committerMarek Olšák <[email protected]>2015-07-23 00:59:23 +0200
commit2369dc83826c7b1f413ff78f55e460c38d7a0660 (patch)
tree0d111812c6bbc9bed75f658cbd6263dc4f6ba94f /src/gallium
parent68dcbf4c4679ad4e62d55e4f2632311aeef38eed (diff)
cso: eliminate some sampler function wrappers
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c39
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.h6
2 files changed, 12 insertions, 33 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 9ee5bdcc942..00686d2af41 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1069,11 +1069,9 @@ unsigned cso_get_aux_vertex_buffer_slot(struct cso_context *ctx)
/**************** 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;
@@ -1109,24 +1107,13 @@ single_sampler(struct cso_context *ctx,
}
}
- 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;
@@ -1142,12 +1129,6 @@ single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
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
@@ -1168,18 +1149,18 @@ cso_set_samplers(struct cso_context *ctx,
*/
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;
}
@@ -1203,7 +1184,7 @@ cso_restore_fragment_samplers(struct cso_context *ctx)
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);
}
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index 3bee4298802..f0a27390d17 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -81,10 +81,8 @@ cso_restore_fragment_samplers(struct cso_context *cso);
* samplers one at a time:
*/
enum pipe_error
-cso_single_sampler(struct cso_context *cso,
- unsigned shader_stage,
- unsigned count,
- const struct pipe_sampler_state *states);
+cso_single_sampler(struct cso_context *cso, unsigned shader_stage,
+ unsigned idx, const struct pipe_sampler_state *states);
void
cso_single_sampler_done(struct cso_context *cso, unsigned shader_stage);