From bfe79babf99e6b9435195178d1ea64687c60d161 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 17 Dec 2007 16:14:29 +0000 Subject: gallium: incorporate alpha state into depth_stencil state object. --- src/mesa/pipe/cso_cache/cso_cache.c | 13 +++---------- src/mesa/pipe/cso_cache/cso_cache.h | 14 ++++---------- 2 files changed, 7 insertions(+), 20 deletions(-) (limited to 'src/mesa/pipe/cso_cache') diff --git a/src/mesa/pipe/cso_cache/cso_cache.c b/src/mesa/pipe/cso_cache/cso_cache.c index 0bba5914dc..9e77e0774d 100644 --- a/src/mesa/pipe/cso_cache/cso_cache.c +++ b/src/mesa/pipe/cso_cache/cso_cache.c @@ -78,7 +78,7 @@ static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_ case CSO_SAMPLER: hash = sc->sampler_hash; break; - case CSO_DEPTH_STENCIL: + case CSO_DEPTH_STENCIL_ALPHA: hash = sc->depth_stencil_hash; break; case CSO_RASTERIZER: @@ -90,9 +90,6 @@ 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; @@ -105,16 +102,14 @@ static int _cso_size_for_type(enum cso_cache_type type) return sizeof(struct pipe_blend_state); case CSO_SAMPLER: return sizeof(struct pipe_sampler_state); - case CSO_DEPTH_STENCIL: - return sizeof(struct pipe_depth_stencil_state); + case CSO_DEPTH_STENCIL_ALPHA: + return sizeof(struct pipe_depth_stencil_alpha_state); case CSO_RASTERIZER: return sizeof(struct pipe_rasterizer_state); case CSO_FRAGMENT_SHADER: 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; } @@ -169,7 +164,6 @@ 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; } @@ -183,6 +177,5 @@ 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 cd36dd51e9..116e2eaa2c 100644 --- a/src/mesa/pipe/cso_cache/cso_cache.h +++ b/src/mesa/pipe/cso_cache/cso_cache.h @@ -40,7 +40,6 @@ struct cso_hash; struct cso_cache { - struct cso_hash *alpha_hash; struct cso_hash *blend_hash; struct cso_hash *depth_stencil_hash; struct cso_hash *fs_hash; @@ -54,8 +53,8 @@ struct cso_blend { void *data; }; -struct cso_depth_stencil { - struct pipe_depth_stencil_state state; +struct cso_depth_stencil_alpha { + struct pipe_depth_stencil_alpha_state state; void *data; }; @@ -79,19 +78,14 @@ 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_DEPTH_STENCIL_ALPHA, CSO_RASTERIZER, CSO_FRAGMENT_SHADER, - CSO_VERTEX_SHADER, - CSO_ALPHA_TEST + CSO_VERTEX_SHADER }; unsigned cso_construct_key(void *item, int item_size); -- cgit v1.2.3