summaryrefslogtreecommitdiff
path: root/src/mesa/cso_cache
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-17 09:47:41 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-18 06:31:22 -0400
commitf117327a3f246713abfd4dc4320d4a1a7f1b811a (patch)
tree81c5c58c0ae0685c917996ad04f10003aa95cfa3 /src/mesa/cso_cache
parente16c045b83f5c5b4f4064df67623bb76b46b6619 (diff)
Make sampler an immutable state object.
Switch the sample to be an immutable state object.
Diffstat (limited to 'src/mesa/cso_cache')
-rw-r--r--src/mesa/cso_cache/cso_cache.c7
-rw-r--r--src/mesa/cso_cache/cso_cache.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/cso_cache/cso_cache.c b/src/mesa/cso_cache/cso_cache.c
index 784d1f970f..61da590575 100644
--- a/src/mesa/cso_cache/cso_cache.c
+++ b/src/mesa/cso_cache/cso_cache.c
@@ -74,6 +74,8 @@ static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_
switch(type) {
case CSO_BLEND:
hash = sc->blend_hash;
+ case CSO_SAMPLER:
+ hash = sc->sampler_hash;
}
return hash;
@@ -84,6 +86,8 @@ static int _cso_size_for_type(enum cso_cache_type type)
switch(type) {
case CSO_BLEND:
return sizeof(struct pipe_blend_state);
+ case CSO_SAMPLER:
+ return sizeof(struct pipe_sampler_state);
}
return 0;
}
@@ -133,6 +137,7 @@ struct cso_cache *cso_cache_create(void)
struct cso_cache *sc = malloc(sizeof(struct cso_cache));
sc->blend_hash = cso_hash_create();
+ sc->sampler_hash = cso_hash_create();
return sc;
}
@@ -140,8 +145,8 @@ struct cso_cache *cso_cache_create(void)
void cso_cache_delete(struct cso_cache *sc)
{
assert(sc);
- assert(sc->blend_hash);
cso_hash_delete(sc->blend_hash);
+ cso_hash_delete(sc->sampler_hash);
free(sc);
}
diff --git a/src/mesa/cso_cache/cso_cache.h b/src/mesa/cso_cache/cso_cache.h
index c022b98d43..05a4cfcbdd 100644
--- a/src/mesa/cso_cache/cso_cache.h
+++ b/src/mesa/cso_cache/cso_cache.h
@@ -41,10 +41,12 @@ struct cso_hash;
struct cso_cache {
struct cso_hash *blend_hash;
+ struct cso_hash *sampler_hash;
};
enum cso_cache_type {
CSO_BLEND,
+ CSO_SAMPLER
};
unsigned cso_construct_key(void *item, int item_size);