Rename prim_stage -> draw_stage
[mesa.git] / src / mesa / pipe / softpipe / sp_prim_setup.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.5
4 *
5 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef S_TRI_H
26 #define S_TRI_H
27
28 /* Vertices are just an array of floats, with all the attributes
29 * packed. We currently assume a layout like:
30 *
31 * attr[0][0..3] - window position
32 * attr[1..n][0..3] - remaining attributes.
33 *
34 * Attributes are assumed to be 4 floats wide but are packed so that
35 * all the enabled attributes run contiguously.
36 */
37
38 #include "glheader.h"
39 #include "imports.h"
40 #if 0
41 #include "s_tri_public.h"
42 #endif
43 #include "s_context.h"
44
45
46 extern struct draw_stage *prim_setup( struct softpipe_context *softpipe );
47
48
49 #if 0 /* UNUSED? */
50 struct tri_context;
51 struct fp_context;
52 struct be_context;
53
54 /* Note the rasterizer does not take a GLcontext argument. This is
55 * deliberate.
56 */
57 struct tri_context *tri_create_context( GLcontext *ctx );
58
59 void tri_destroy_context( struct tri_context *tri );
60
61 void tri_set_fp_context( struct tri_context *tri,
62 struct fp_context *fp,
63 void (*fp_run)( struct fp_context *fp,
64 const struct fp_inputs *,
65 struct fp_outputs * ));
66
67
68 void tri_set_be_context( struct tri_context *tri,
69 struct be_context *be,
70 void (*be_run)( struct be_context *be,
71 const struct fp_outputs * ));
72
73 void tri_set_attribs( struct tri_context *tri,
74 const struct attr_info *info,
75 GLuint nr_attrib );
76
77 void tri_set_backface( struct tri_context *tri,
78 GLfloat backface );
79
80 void tri_set_scissor( struct tri_context *tri,
81 GLint x,
82 GLint y,
83 GLuint width,
84 GLuint height,
85 GLboolean enabled );
86
87 void tri_set_stipple( struct tri_context *tri,
88 const GLuint *pattern,
89 GLboolean enabled );
90
91 /* Unfilled triangles will be handled elsewhere (higher in the
92 * pipeline), as will things like stipple (lower in the pipeline).
93 */
94
95 void tri_triangle( struct tri_context *tri,
96 const struct vertex *v0,
97 const struct vertex *v1,
98 const struct vertex *v2 );
99
100 /* TODO: rasterize_line, rasterize_point??
101 * How will linestipple work?
102 */
103
104
105 #ifdef SETUP_PRIVATE
106
107
108
109
110
111
112 GLboolean tri_setup( struct tri_context *tri,
113 const struct vertex *v0,
114 const struct vertex *v1,
115 const struct vertex *v2 );
116
117 void tri_rasterize( struct tri_context *tri );
118 void tri_rasterize_spans( struct tri_context *tri );
119
120
121
122
123
124
125 #endif
126 #endif
127 #endif