void cso_set_maximum_cache_size(struct cso_cache *sc, int number) { int i; sc->max_size = number; for (i = 0; i < CSO_CACHE_MAX; i++) sanitize_hash(sc, sc->hashes[i], i, sc->max_size); }
struct cso_hash_iter cso_insert_state(struct cso_cache *sc, unsigned hash_key, enum cso_cache_type type, void *state) { struct cso_hash *hash = _cso_hash_for_type(sc, type); sanitize_hash(sc, hash, type, sc->max_size); return cso_hash_insert(hash, hash_key, state); }
void cso_set_maximum_cache_size(struct cso_cache *sc, int number) { sc->max_size = number; sanitize_hash(sc, sc->blend_hash, CSO_BLEND, sc->max_size); sanitize_hash(sc, sc->depth_stencil_hash, CSO_DEPTH_STENCIL_ALPHA, sc->max_size); sanitize_hash(sc, sc->fs_hash, CSO_FRAGMENT_SHADER, sc->max_size); sanitize_hash(sc, sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size); sanitize_hash(sc, sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size); sanitize_hash(sc, sc->sampler_hash, CSO_SAMPLER, sc->max_size); sanitize_hash(sc, sc->velements_hash, CSO_VELEMENTS, sc->max_size); }