diff options
Diffstat (limited to 'src/mesa/cso_cache/cso_cache.h')
-rw-r--r-- | src/mesa/cso_cache/cso_cache.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/src/mesa/cso_cache/cso_cache.h b/src/mesa/cso_cache/cso_cache.h index ca0a2d576a..c022b98d43 100644 --- a/src/mesa/cso_cache/cso_cache.h +++ b/src/mesa/cso_cache/cso_cache.h @@ -33,43 +33,34 @@ #ifndef CSO_CACHE_H #define CSO_CACHE_H -#include "state_tracker/st_context.h" #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "main/hash.h" - -struct cso_cache_item { - unsigned key; - - unsigned state_size; - const void *state; - - struct cso_cache_item *next; -}; +struct cso_hash; struct cso_cache { - struct _mesa_HashTable *hash; + struct cso_hash *blend_hash; }; -void cso_cache_destroy(struct cso_cache *sc); -struct cso_cache *cso_cache_create(void); +enum cso_cache_type { + CSO_BLEND, +}; unsigned cso_construct_key(void *item, int item_size); -struct cso_cache_item *cso_insert_state(struct cso_cache *sc, - unsigned hash_key, - void *state, int state_size); -struct cso_cache_item *cso_find_state(struct cso_cache *sc, - unsigned hash_key, - void *state, int state_size); -struct cso_cache_item *cso_remove_state(struct cso_cache *sc, - unsigned hash_key, - void *state, int state_size); +struct cso_cache *cso_cache_create(void); +void cso_cache_delete(struct cso_cache *sc); -struct pipe_blend_state *cso_cached_blend_state( - struct st_context *pipe, - const struct pipe_blend_state *state); +struct cso_hash_iter cso_insert_state(struct cso_cache *sc, + unsigned hash_key, enum cso_cache_type type, + void *state); +struct cso_hash_iter cso_find_state(struct cso_cache *sc, + unsigned hash_key, enum cso_cache_type type); +struct cso_hash_iter cso_find_state_template(struct cso_cache *sc, + unsigned hash_key, enum cso_cache_type type, + void *templ); +void * cso_take_state(struct cso_cache *sc, unsigned hash_key, + enum cso_cache_type type); #endif |