summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-04-24 11:56:06 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-04-24 12:15:05 -0600
commitac79532a15a7109bf0fbd0e40a1ba8e65ed8c435 (patch)
tree8a3fdd61a312c8f8c90ee1728b7dd3578fd9f318 /src/gallium/auxiliary/cso_cache
parentf2c31257167f85df276322be1b8523064e8b66a9 (diff)
gallium: tweak the new shader delete funcs
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index cfb91d31de..febecbbbde 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -485,10 +485,12 @@ enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
void cso_delete_fragment_shader(struct cso_context *ctx, void *handle )
{
- if (handle == ctx->fragment_shader)
+ if (handle == ctx->fragment_shader) {
+ /* unbind before deleting */
ctx->pipe->bind_fs_state(ctx->pipe, NULL);
+ ctx->fragment_shader = NULL;
+ }
ctx->pipe->delete_fs_state(ctx->pipe, handle);
- ctx->fragment_shader = NULL;
}
/* Not really working:
@@ -564,10 +566,12 @@ enum pipe_error cso_set_vertex_shader_handle(struct cso_context *ctx,
void cso_delete_vertex_shader(struct cso_context *ctx, void *handle )
{
- if (handle == ctx->vertex_shader)
+ if (handle == ctx->vertex_shader) {
+ /* unbind before deleting */
ctx->pipe->bind_vs_state(ctx->pipe, NULL);
+ ctx->vertex_shader = NULL;
+ }
ctx->pipe->delete_vs_state(ctx->pipe, handle);
- ctx->vertex_shader = NULL;
}