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"
39 #include "cso_hash.h" /* for cso_hash_iter, as MSVC requires structures returned by value to be fully defined */
48 struct cso_hash
*blend_hash
;
49 struct cso_hash
*depth_stencil_hash
;
50 struct cso_hash
*fs_hash
;
51 struct cso_hash
*vs_hash
;
52 struct cso_hash
*rasterizer_hash
;
53 struct cso_hash
*sampler_hash
;
57 struct pipe_blend_state state
;
61 struct cso_depth_stencil_alpha
{
62 struct pipe_depth_stencil_alpha_state state
;
66 struct cso_rasterizer
{
67 struct pipe_rasterizer_state state
;
71 struct cso_fragment_shader
{
72 struct pipe_shader_state state
;
76 struct cso_vertex_shader
{
77 struct pipe_shader_state state
;
82 struct pipe_sampler_state state
;
90 CSO_DEPTH_STENCIL_ALPHA
,
96 unsigned cso_construct_key(void *item
, int item_size
);
98 struct cso_cache
*cso_cache_create(void);
99 void cso_cache_delete(struct cso_cache
*sc
);
101 struct cso_hash_iter
cso_insert_state(struct cso_cache
*sc
,
102 unsigned hash_key
, enum cso_cache_type type
,
104 struct cso_hash_iter
cso_find_state(struct cso_cache
*sc
,
105 unsigned hash_key
, enum cso_cache_type type
);
106 struct cso_hash_iter
cso_find_state_template(struct cso_cache
*sc
,
107 unsigned hash_key
, enum cso_cache_type type
,
109 void * cso_take_state(struct cso_cache
*sc
, unsigned hash_key
,
110 enum cso_cache_type type
);