include surface.offset in address calculations
[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
26 #ifndef SP_PRIM_SETUP_H
27 #define SP_PRIM_SETUP_H
28
29
30 /* Vertices are just an array of floats, with all the attributes
31 * packed. We currently assume a layout like:
32 *
33 * attr[0][0..3] - window position
34 * attr[1..n][0..3] - remaining attributes.
35 *
36 * Attributes are assumed to be 4 floats wide but are packed so that
37 * all the enabled attributes run contiguously.
38 */
39
40 #include "glheader.h"
41 #include "imports.h"
42 #if 0
43 #include "s_tri_public.h"
44 #include "s_context.h"
45 #endif
46
47
48 extern struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe );
49
50
51 #if 0 /* UNUSED? */
52 struct tri_context;
53 struct fp_context;
54 struct be_context;
55
56 /* Note the rasterizer does not take a GLcontext argument. This is
57 * deliberate.
58 */
59 struct tri_context *tri_create_context( GLcontext *ctx );
60
61 void tri_destroy_context( struct tri_context *tri );
62
63 void tri_set_fp_context( struct tri_context *tri,
64 struct fp_context *fp,
65 void (*fp_run)( struct fp_context *fp,
66 const struct fp_inputs *,
67 struct fp_outputs * ));
68
69
70 void tri_set_be_context( struct tri_context *tri,
71 struct be_context *be,
72 void (*be_run)( struct be_context *be,
73 const struct fp_outputs * ));
74
75 void tri_set_attribs( struct tri_context *tri,
76 const struct attr_info *info,
77 GLuint nr_attrib );
78
79 void tri_set_backface( struct tri_context *tri,
80 GLfloat backface );
81
82 void tri_set_scissor( struct tri_context *tri,
83 GLint x,
84 GLint y,
85 GLuint width,
86 GLuint height,
87 GLboolean enabled );
88
89 void tri_set_stipple( struct tri_context *tri,
90 const GLuint *pattern,
91 GLboolean enabled );
92
93 /* Unfilled triangles will be handled elsewhere (higher in the
94 * pipeline), as will things like stipple (lower in the pipeline).
95 */
96
97 void tri_triangle( struct tri_context *tri,
98 const struct vertex *v0,
99 const struct vertex *v1,
100 const struct vertex *v2 );
101
102 /* TODO: rasterize_line, rasterize_point??
103 * How will linestipple work?
104 */
105
106
107 #ifdef SETUP_PRIVATE
108
109 GLboolean tri_setup( struct tri_context *tri,
110 const struct vertex *v0,
111 const struct vertex *v1,
112 const struct vertex *v2 );
113
114 void tri_rasterize( struct tri_context *tri );
115 void tri_rasterize_spans( struct tri_context *tri );
116
117 #endif
118
119
120 #endif
121
122 #endif /* SP_PRIM_SETUP_H */