diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2008-04-30 02:04:28 -0400 |
---|---|---|
committer | Zack Rusin <zack@tungstengraphics.com> | 2008-04-30 15:04:58 -0400 |
commit | 026e31a068981724fb0c98f6d1fc87d086fd2da6 (patch) | |
tree | ceec25637fe673052b686ad1e9c7821bd9f2d238 /src/gallium/auxiliary/cso_cache/cso_cache.h | |
parent | dadb11f5d96354975f1c9f7c8134bb4727129249 (diff) |
try to fix the deleting of the bound cso during cleanup of the hash
Diffstat (limited to 'src/gallium/auxiliary/cso_cache/cso_cache.h')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_cache.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.h b/src/gallium/auxiliary/cso_cache/cso_cache.h index e5edbbb556..6b5c230e8f 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.h +++ b/src/gallium/auxiliary/cso_cache/cso_cache.h @@ -84,8 +84,22 @@ extern "C" { #endif +enum cso_cache_type { + CSO_BLEND, + CSO_SAMPLER, + CSO_DEPTH_STENCIL_ALPHA, + CSO_RASTERIZER, + CSO_FRAGMENT_SHADER, + CSO_VERTEX_SHADER +}; + typedef void (*cso_state_callback)(void *ctx, void *obj); +typedef void (*cso_sanitize_callback)(struct cso_hash *hash, + enum cso_cache_type type, + int max_size, + void *user_data); + struct cso_cache; struct cso_blend { @@ -130,21 +144,15 @@ struct cso_sampler { struct pipe_context *context; }; - -enum cso_cache_type { - CSO_BLEND, - CSO_SAMPLER, - CSO_DEPTH_STENCIL_ALPHA, - CSO_RASTERIZER, - CSO_FRAGMENT_SHADER, - CSO_VERTEX_SHADER -}; - unsigned cso_construct_key(void *item, int item_size); struct cso_cache *cso_cache_create(void); void cso_cache_delete(struct cso_cache *sc); +void cso_cache_set_sanitize_callback(struct cso_cache *sc, + cso_sanitize_callback cb, + void *user_data); + struct cso_hash_iter cso_insert_state(struct cso_cache *sc, unsigned hash_key, enum cso_cache_type type, void *state); |