summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-03-18 17:14:05 -0600
committerBrian <[email protected]>2008-03-18 17:18:11 -0600
commite5b19a0f833b5a3d5ffcf50d25a620d00bd8914b (patch)
treedc29b43dc30ffb1ba30c9da6db10e61c0764c734 /src/gallium/auxiliary/cso_cache
parent84836ffce1ca322f91aaae25c4de2be20e55a4b5 (diff)
gallium: added cso_unset_*() functions
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...
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c36
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.h13
2 files changed, 48 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index fd86bfaca9c..294ac82281e 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -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;
+}
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index 1f2a6308043..6aa619abf56 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -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 );