diff options
author | Brian Paul <[email protected]> | 2008-04-24 11:59:22 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-04-24 12:15:05 -0600 |
commit | a41804909d5799cddfbf48a46524f78c736408d4 (patch) | |
tree | a5e97975da89a196804f83ca14390e380a28ab59 /src | |
parent | ac79532a15a7109bf0fbd0e40a1ba8e65ed8c435 (diff) |
gallium: minor clean-ups, comments
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index febecbbbdeb..8cf2313b7fb 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -102,6 +102,10 @@ out: return NULL; } + +/** + * Prior to context destruction, this function unbinds all state objects. + */ static void cso_release_all( struct cso_context *ctx ) { unsigned i; @@ -115,10 +119,10 @@ static void cso_release_all( struct cso_context *ctx ) ctx->pipe->bind_vs_state( ctx->pipe, NULL ); } - for (i = 0; i < PIPE_MAX_SAMPLERS; i++) + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { pipe_texture_reference(&ctx->textures[i], NULL); - for (i = 0; i < PIPE_MAX_SAMPLERS; i++) pipe_texture_reference(&ctx->textures_saved[i], NULL); + } if (ctx->cache) { cso_cache_delete( ctx->cache ); @@ -129,10 +133,10 @@ static void cso_release_all( struct cso_context *ctx ) void cso_destroy_context( struct cso_context *ctx ) { - if (ctx) + if (ctx) { cso_release_all( ctx ); - - FREE( ctx ); + FREE( ctx ); + } } |