Commit faa14818 authored by Michał Król's avatar Michał Król
Browse files

cso: Remove set/save/restore_vertex_sampler_textures().

parent b8030c65
......@@ -76,18 +76,14 @@ struct cso_context {
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
uint nr_textures;
struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS];
uint nr_vertex_sampler_views;
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
uint nr_vertex_textures;
uint nr_textures_saved;
struct pipe_texture *textures_saved[PIPE_MAX_SAMPLERS];
uint nr_fragment_sampler_views_saved;
struct pipe_sampler_view *fragment_sampler_views_saved[PIPE_MAX_SAMPLERS];
uint nr_vertex_textures_saved;
struct pipe_texture *vertex_textures_saved[PIPE_MAX_VERTEX_SAMPLERS];
uint nr_vertex_sampler_views_saved;
struct pipe_sampler_view *vertex_sampler_views_saved[PIPE_MAX_VERTEX_SAMPLERS];
......@@ -310,8 +306,6 @@ void cso_release_all( struct cso_context *ctx )
}
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
pipe_texture_reference(&ctx->vertex_textures[i], NULL);
pipe_texture_reference(&ctx->vertex_textures_saved[i], NULL);
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
pipe_sampler_view_reference(&ctx->vertex_sampler_views_saved[i], NULL);
}
......@@ -706,87 +700,6 @@ void cso_restore_sampler_textures( struct cso_context *ctx )
}
enum pipe_error
cso_set_vertex_sampler_textures(struct cso_context *ctx,
uint count,
struct pipe_texture **textures)
{
uint i;
ctx->nr_vertex_textures = count;
for (i = 0; i < count; i++) {
struct pipe_sampler_view templ, *view;
u_sampler_view_default_template(&templ,
textures[i],
textures[i]->format);
view = ctx->pipe->create_sampler_view(ctx->pipe,
textures[i],
&templ);
pipe_texture_reference(&ctx->vertex_textures[i], textures[i]);
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], view);
}
for ( ; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
pipe_texture_reference(&ctx->vertex_textures[i], NULL);
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
}
ctx->pipe->set_vertex_sampler_views(ctx->pipe,
count,
ctx->vertex_sampler_views);
return PIPE_OK;
}
void
cso_save_vertex_sampler_textures(struct cso_context *ctx)
{
uint i;
ctx->nr_vertex_textures_saved = ctx->nr_vertex_textures;
for (i = 0; i < ctx->nr_vertex_textures; i++) {
assert(!ctx->vertex_textures_saved[i]);
assert(!ctx->vertex_sampler_views_saved[i]);
pipe_texture_reference(&ctx->vertex_textures_saved[i], ctx->vertex_textures[i]);
pipe_sampler_view_reference(&ctx->vertex_sampler_views_saved[i],
ctx->vertex_sampler_views[i]);
}
}
void
cso_restore_vertex_sampler_textures(struct cso_context *ctx)
{
uint i;
ctx->nr_vertex_textures = ctx->nr_vertex_textures_saved;
for (i = 0; i < ctx->nr_vertex_textures; i++) {
pipe_texture_reference(&ctx->vertex_textures[i], NULL);
ctx->vertex_textures[i] = ctx->vertex_textures_saved[i];
ctx->vertex_textures_saved[i] = NULL;
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
ctx->vertex_sampler_views[i] = ctx->vertex_sampler_views_saved[i];
ctx->vertex_sampler_views_saved[i] = NULL;
}
for ( ; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
pipe_texture_reference(&ctx->vertex_textures[i], NULL);
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
}
ctx->pipe->set_vertex_sampler_views(ctx->pipe,
ctx->nr_vertex_textures,
ctx->vertex_sampler_views);
ctx->nr_vertex_textures_saved = 0;
}
enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
const struct pipe_depth_stencil_alpha_state *templ)
{
......
......@@ -111,17 +111,6 @@ void cso_save_sampler_textures( struct cso_context *cso );
void cso_restore_sampler_textures( struct cso_context *cso );
enum pipe_error
cso_set_vertex_sampler_textures(struct cso_context *cso,
uint count,
struct pipe_texture **textures);
void
cso_save_vertex_sampler_textures(struct cso_context *cso);
void
cso_restore_vertex_sampler_textures(struct cso_context *cso);
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
unsigned count,
const struct pipe_vertex_element *states);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment