cso: Remove set/save/restore_vertex_sampler_textures().
authorMichal Krol <michal@vmware.com>
Fri, 12 Mar 2010 13:43:11 +0000 (14:43 +0100)
committerMichal Krol <michal@vmware.com>
Fri, 12 Mar 2010 13:43:11 +0000 (14:43 +0100)
src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/cso_cache/cso_context.h

index 5c16e0959d68092ec08bd25249b29aae81d408f5..648ba10a9959bb85da962f49432bb61c243bcf18 100644 (file)
@@ -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)
 {
index e476cf4adef2b56ec1ac48720fb7d75b7a3b0f3e..a24077e009c8ff71c2c56d00f0b2b727c05c389b 100644 (file)
@@ -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);