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 **************************************************************************/
28 #ifndef PIPE_CONTEXT_H
29 #define PIPE_CONTEXT_H
31 #include "main/mtypes.h"
37 extern struct pipe_context
*softpipe_create( void );
39 /* Drawing currently kludged up via the existing tnl/ module.
45 * Software pipeline rendering context. Basically a collection of
46 * state setting functions, plus VBO drawing entrypoint.
50 void (*destroy
)( struct pipe_context
* );
55 void (*draw_vb
)( struct pipe_context
*pipe
,
56 struct vertex_buffer
*VB
);
58 /** Clear framebuffer */
59 void (*clear
)(struct pipe_context
*pipe
, GLboolean color
, GLboolean depth
,
60 GLboolean stencil
, GLboolean accum
);
62 /** occlusion counting (XXX this may be temporary - we should probably
63 * have generic query objects with begin/end methods)
65 void (*reset_occlusion_counter
)(struct pipe_context
*pipe
);
66 GLuint (*get_occlusion_counter
)(struct pipe_context
*pipe
);
71 void (*set_alpha_test_state
)( struct pipe_context
*,
72 const struct pipe_alpha_test_state
* );
74 void (*set_blend_state
)( struct pipe_context
*,
75 const struct pipe_blend_state
* );
77 void (*set_blend_color
)( struct pipe_context
*,
78 const struct pipe_blend_color
* );
80 void (*set_clip_state
)( struct pipe_context
*,
81 const struct pipe_clip_state
* );
83 void (*set_clear_color_state
)( struct pipe_context
*,
84 const struct pipe_clear_color_state
* );
86 void (*set_depth_state
)( struct pipe_context
*,
87 const struct pipe_depth_state
* );
89 void (*set_framebuffer_state
)( struct pipe_context
*,
90 const struct pipe_framebuffer_state
* );
92 void (*set_fs_state
)( struct pipe_context
*,
93 const struct pipe_fs_state
* );
95 void (*set_polygon_stipple
)( struct pipe_context
*,
96 const struct pipe_poly_stipple
* );
98 void (*set_setup_state
)( struct pipe_context
*,
99 const struct pipe_setup_state
* );
101 void (*set_scissor_state
)( struct pipe_context
*,
102 const struct pipe_scissor_state
* );
104 void (*set_stencil_state
)( struct pipe_context
*,
105 const struct pipe_stencil_state
* );
107 void (*set_sampler_state
)( struct pipe_context
*,
109 const struct pipe_sampler_state
* );
111 void (*set_texture_state
)( struct pipe_context
*,
113 struct pipe_texture_object
* );
115 void (*set_viewport_state
)( struct pipe_context
*,
116 const struct pipe_viewport_state
* );