Merge branch 'master' of git+ssh://michal@git.freedesktop.org/git/mesa/mesa into...
[mesa.git] / src / mesa / pipe / p_context.h
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
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:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
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.
25 *
26 **************************************************************************/
27
28 #ifndef PIPE_CONTEXT_H
29 #define PIPE_CONTEXT_H
30
31 #include "main/mtypes.h"
32 #include "p_state.h"
33
34
35 /* Kludge:
36 */
37 extern struct pipe_context *softpipe_create( void );
38
39 /* Drawing currently kludged up via the existing tnl/ module.
40 */
41 struct vertex_buffer;
42
43
44 /**
45 * Software pipeline rendering context. Basically a collection of
46 * state setting functions, plus VBO drawing entrypoint.
47 */
48 struct pipe_context {
49
50 void (*destroy)( struct pipe_context * );
51
52 /*
53 * Drawing
54 */
55 void (*draw_vb)( struct pipe_context *pipe,
56 struct vertex_buffer *VB );
57
58 /** Clear framebuffer */
59 void (*clear)(struct pipe_context *pipe, GLboolean color, GLboolean depth,
60 GLboolean stencil, GLboolean accum);
61
62 /** occlusion counting (XXX this may be temporary - we should probably
63 * have generic query objects with begin/end methods)
64 */
65 void (*reset_occlusion_counter)(struct pipe_context *pipe);
66 GLuint (*get_occlusion_counter)(struct pipe_context *pipe);
67
68 /*
69 * State functions
70 */
71 void (*set_alpha_test_state)( struct pipe_context *,
72 const struct pipe_alpha_test_state * );
73
74 void (*set_blend_state)( struct pipe_context *,
75 const struct pipe_blend_state * );
76
77 void (*set_blend_color)( struct pipe_context *,
78 const struct pipe_blend_color * );
79
80 void (*set_clip_state)( struct pipe_context *,
81 const struct pipe_clip_state * );
82
83 void (*set_clear_color_state)( struct pipe_context *,
84 const struct pipe_clear_color_state * );
85
86 void (*set_depth_state)( struct pipe_context *,
87 const struct pipe_depth_state * );
88
89 void (*set_framebuffer_state)( struct pipe_context *,
90 const struct pipe_framebuffer_state * );
91
92 void (*set_fs_state)( struct pipe_context *,
93 const struct pipe_fs_state * );
94
95 void (*set_polygon_stipple)( struct pipe_context *,
96 const struct pipe_poly_stipple * );
97
98 void (*set_setup_state)( struct pipe_context *,
99 const struct pipe_setup_state * );
100
101 void (*set_scissor_state)( struct pipe_context *,
102 const struct pipe_scissor_state * );
103
104 void (*set_stencil_state)( struct pipe_context *,
105 const struct pipe_stencil_state * );
106
107 void (*set_sampler_state)( struct pipe_context *,
108 GLuint unit,
109 const struct pipe_sampler_state * );
110
111 void (*set_texture_state)( struct pipe_context *,
112 GLuint unit,
113 struct pipe_texture_object * );
114
115 void (*set_viewport_state)( struct pipe_context *,
116 const struct pipe_viewport_state * );
117 };
118
119
120 #endif