1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 * Zack Rusin <zack@tungstengraphics.com>
36 #include "pipe/p_context.h"
37 #include "pipe/p_state.h"
43 struct cso_hash
*blend_hash
;
44 struct cso_hash
*depth_stencil_hash
;
45 struct cso_hash
*fs_hash
;
46 struct cso_hash
*vs_hash
;
47 struct cso_hash
*rasterizer_hash
;
48 struct cso_hash
*sampler_hash
;
52 struct pipe_blend_state state
;
56 struct cso_depth_stencil_alpha
{
57 struct pipe_depth_stencil_alpha_state state
;
61 struct cso_rasterizer
{
62 struct pipe_rasterizer_state state
;
66 struct cso_fragment_shader
{
67 struct pipe_shader_state state
;
71 struct cso_vertex_shader
{
72 struct pipe_shader_state state
;
77 struct pipe_sampler_state state
;
85 CSO_DEPTH_STENCIL_ALPHA
,
91 unsigned cso_construct_key(void *item
, int item_size
);
93 struct cso_cache
*cso_cache_create(void);
94 void cso_cache_delete(struct cso_cache
*sc
);
96 struct cso_hash_iter
cso_insert_state(struct cso_cache
*sc
,
97 unsigned hash_key
, enum cso_cache_type type
,
99 struct cso_hash_iter
cso_find_state(struct cso_cache
*sc
,
100 unsigned hash_key
, enum cso_cache_type type
);
101 struct cso_hash_iter
cso_find_state_template(struct cso_cache
*sc
,
102 unsigned hash_key
, enum cso_cache_type type
,
104 void * cso_take_state(struct cso_cache
*sc
, unsigned hash_key
,
105 enum cso_cache_type type
);