OSDN Git Service

gallium: added cso_unset_*() functions
authorBrian <brian.paul@tungstengraphics.com>
Tue, 18 Mar 2008 23:14:05 +0000 (17:14 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 18 Mar 2008 23:18:11 +0000 (17:18 -0600)
If we go behind the CSO context's back and set pipe state directly we
need to invalidate the CSO's 'current' pointers.
This will be revisited...

src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/cso_cache/cso_context.h

index fd86bfa..294ac82 100644 (file)
@@ -149,6 +149,12 @@ void cso_set_blend(struct cso_context *ctx,
    }
 }
 
+void cso_unset_blend(struct cso_context *ctx)
+{
+   ctx->blend = NULL;
+}
+
+
 void cso_single_sampler(struct cso_context *ctx,
                         unsigned idx,
                         const struct pipe_sampler_state *templ)
@@ -220,6 +226,15 @@ void cso_set_samplers( struct cso_context *ctx,
    cso_single_sampler_done( ctx );
 }
 
+void cso_unset_samplers( struct cso_context *ctx )
+{
+   uint i;
+   for (i = 0; i < ctx->nr_samplers; i++)
+      ctx->samplers[i] = NULL;
+}
+
+
+
 void cso_set_depth_stencil_alpha(struct cso_context *ctx,
                                  const struct pipe_depth_stencil_alpha_state *templ)
 {
@@ -252,6 +267,11 @@ void cso_set_depth_stencil_alpha(struct cso_context *ctx,
    }
 }
 
+void cso_unset_depth_stencil_alpha(struct cso_context *ctx)
+{
+   ctx->depth_stencil = NULL;
+}
+
 
 
 void cso_set_rasterizer(struct cso_context *ctx,
@@ -285,7 +305,10 @@ void cso_set_rasterizer(struct cso_context *ctx,
    }
 }
 
-
+void cso_unset_rasterizer(struct cso_context *ctx)
+{
+   ctx->rasterizer = NULL;
+}
 
 
 
@@ -320,6 +343,12 @@ void cso_set_fragment_shader(struct cso_context *ctx,
    }
 }
 
+void cso_unset_fragment_shader(struct cso_context *ctx)
+{
+   ctx->fragment_shader = NULL;
+}
+
+
 void cso_set_vertex_shader(struct cso_context *ctx,
                            const struct pipe_shader_state *templ)
 {
@@ -350,3 +379,8 @@ void cso_set_vertex_shader(struct cso_context *ctx,
       ctx->pipe->bind_vs_state(ctx->pipe, handle);
    }
 }
+
+void cso_unset_vertex_shader(struct cso_context *ctx)
+{
+   ctx->vertex_shader = NULL;
+}
index 1f2a630..6aa619a 100644 (file)
@@ -44,16 +44,25 @@ struct cso_context *cso_create_context( struct pipe_context *pipe );
 void cso_set_blend( struct cso_context *cso,
                     const struct pipe_blend_state *blend );
 
+void cso_unset_blend(struct cso_context *cso);
+
 void cso_set_depth_stencil_alpha( struct cso_context *cso,
                                   const struct pipe_depth_stencil_alpha_state *dsa );
 
+void cso_unset_depth_stencil_alpha( struct cso_context *cso );
+
 void cso_set_rasterizer( struct cso_context *cso,
                          const struct pipe_rasterizer_state *rasterizer );
 
+void cso_unset_rasterizer( struct cso_context *cso );
+
 void cso_set_samplers( struct cso_context *cso,
                        unsigned count,
                        const struct pipe_sampler_state **states );
 
+void cso_unset_samplers( struct cso_context *cso );
+
+
 /* Alternate interface to support state trackers that like to modify
  * samplers one at a time:
  */
@@ -72,9 +81,13 @@ void cso_single_sampler_done( struct cso_context *cso );
 void cso_set_fragment_shader( struct cso_context *cso,
                               const struct pipe_shader_state *shader );
 
+void cso_unset_fragment_shader( struct cso_context *cso );
+
 void cso_set_vertex_shader( struct cso_context *cso,
                             const struct pipe_shader_state *shader );
 
+void cso_unset_vertex_shader( struct cso_context *cso );
+
 void cso_destroy_context( struct cso_context *cso );