summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cso_cache
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-21 07:00:20 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-21 07:00:20 -0400
commit6cb87cf26f904b891faa42268f373864fa33541d (patch)
tree3af84bdc648094b7515ed924bd5d3b2f4e03c407 /src/mesa/pipe/cso_cache
parentb0fa489eba9170c4b102bf0feb1b1c3f02a34e4e (diff)
Make the alpha test state a cso.
Diffstat (limited to 'src/mesa/pipe/cso_cache')
-rw-r--r--src/mesa/pipe/cso_cache/cso_cache.c7
-rw-r--r--src/mesa/pipe/cso_cache/cso_cache.h13
2 files changed, 17 insertions, 3 deletions
diff --git a/src/mesa/pipe/cso_cache/cso_cache.c b/src/mesa/pipe/cso_cache/cso_cache.c
index 71f0d08726..0bba5914dc 100644
--- a/src/mesa/pipe/cso_cache/cso_cache.c
+++ b/src/mesa/pipe/cso_cache/cso_cache.c
@@ -90,6 +90,9 @@ static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
+ case CSO_ALPHA_TEST:
+ hash = sc->alpha_hash;
+ break;
}
return hash;
@@ -110,6 +113,8 @@ static int _cso_size_for_type(enum cso_cache_type type)
return sizeof(struct pipe_shader_state);
case CSO_VERTEX_SHADER:
return sizeof(struct pipe_shader_state);
+ case CSO_ALPHA_TEST:
+ return sizeof(struct pipe_alpha_test_state);
}
return 0;
}
@@ -164,6 +169,7 @@ struct cso_cache *cso_cache_create(void)
sc->rasterizer_hash = cso_hash_create();
sc->fs_hash = cso_hash_create();
sc->vs_hash = cso_hash_create();
+ sc->alpha_hash = cso_hash_create();
return sc;
}
@@ -177,5 +183,6 @@ void cso_cache_delete(struct cso_cache *sc)
cso_hash_delete(sc->rasterizer_hash);
cso_hash_delete(sc->fs_hash);
cso_hash_delete(sc->vs_hash);
+ cso_hash_delete(sc->alpha_hash);
free(sc);
}
diff --git a/src/mesa/pipe/cso_cache/cso_cache.h b/src/mesa/pipe/cso_cache/cso_cache.h
index 2acb58c66b..cd36dd51e9 100644
--- a/src/mesa/pipe/cso_cache/cso_cache.h
+++ b/src/mesa/pipe/cso_cache/cso_cache.h
@@ -40,12 +40,13 @@
struct cso_hash;
struct cso_cache {
+ struct cso_hash *alpha_hash;
struct cso_hash *blend_hash;
- struct cso_hash *sampler_hash;
struct cso_hash *depth_stencil_hash;
- struct cso_hash *rasterizer_hash;
struct cso_hash *fs_hash;
struct cso_hash *vs_hash;
+ struct cso_hash *rasterizer_hash;
+ struct cso_hash *sampler_hash;
};
struct cso_blend {
@@ -78,13 +79,19 @@ struct cso_sampler {
void *data;
};
+struct cso_alpha_test {
+ struct pipe_alpha_test_state state;
+ void *data;
+};
+
enum cso_cache_type {
CSO_BLEND,
CSO_SAMPLER,
CSO_DEPTH_STENCIL,
CSO_RASTERIZER,
CSO_FRAGMENT_SHADER,
- CSO_VERTEX_SHADER
+ CSO_VERTEX_SHADER,
+ CSO_ALPHA_TEST
};
unsigned cso_construct_key(void *item, int item_size);