Renamed softpipe directories and files to something less confusing.
[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 #include "s_tri_public.h"
41 #include "s_context.h"
42
43
44
45 struct tri_context;
46 struct fp_context;
47 struct be_context;
48
49 /* Note the rasterizer does not take a GLcontext argument. This is
50 * deliberate.
51 */
52 struct tri_context *tri_create_context( GLcontext *ctx );
53
54 void tri_destroy_context( struct tri_context *tri );
55
56 void tri_set_fp_context( struct tri_context *tri,
57 struct fp_context *fp,
58 void (*fp_run)( struct fp_context *fp,
59 const struct fp_inputs *,
60 struct fp_outputs * ));
61
62
63 void tri_set_be_context( struct tri_context *tri,
64 struct be_context *be,
65 void (*be_run)( struct be_context *be,
66 const struct fp_outputs * ));
67
68 void tri_set_attribs( struct tri_context *tri,
69 const struct attr_info *info,
70 GLuint nr_attrib );
71
72 void tri_set_backface( struct tri_context *tri,
73 GLfloat backface );
74
75 void tri_set_scissor( struct tri_context *tri,
76 GLint x,
77 GLint y,
78 GLuint width,
79 GLuint height,
80 GLboolean enabled );
81
82 void tri_set_stipple( struct tri_context *tri,
83 const GLuint *pattern,
84 GLboolean enabled );
85
86 /* Unfilled triangles will be handled elsewhere (higher in the
87 * pipeline), as will things like stipple (lower in the pipeline).
88 */
89
90 void tri_triangle( struct tri_context *tri,
91 const struct vertex *v0,
92 const struct vertex *v1,
93 const struct vertex *v2 );
94
95 /* TODO: rasterize_line, rasterize_point??
96 * How will linestipple work?
97 */
98
99
100 #ifdef SETUP_PRIVATE
101
102
103
104
105
106
107 GLboolean tri_setup( struct tri_context *tri,
108 const struct vertex *v0,
109 const struct vertex *v1,
110 const struct vertex *v2 );
111
112 void tri_rasterize( struct tri_context *tri );
113 void tri_rasterize_spans( struct tri_context *tri );
114
115
116
117
118
119
120 #endif
121 #endif