2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
26 #ifndef SP_PRIM_SETUP_H
27 #define SP_PRIM_SETUP_H
30 /* Vertices are just an array of floats, with all the attributes
31 * packed. We currently assume a layout like:
33 * attr[0][0..3] - window position
34 * attr[1..n][0..3] - remaining attributes.
36 * Attributes are assumed to be 4 floats wide but are packed so that
37 * all the enabled attributes run contiguously.
43 #include "s_tri_public.h"
44 #include "s_context.h"
48 extern struct draw_stage
*sp_draw_render_stage( struct softpipe_context
*softpipe
);
56 /* Note the rasterizer does not take a GLcontext argument. This is
59 struct tri_context
*tri_create_context( GLcontext
*ctx
);
61 void tri_destroy_context( struct tri_context
*tri
);
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
* ));
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
* ));
75 void tri_set_attribs( struct tri_context
*tri
,
76 const struct attr_info
*info
,
79 void tri_set_backface( struct tri_context
*tri
,
82 void tri_set_scissor( struct tri_context
*tri
,
89 void tri_set_stipple( struct tri_context
*tri
,
90 const GLuint
*pattern
,
93 /* Unfilled triangles will be handled elsewhere (higher in the
94 * pipeline), as will things like stipple (lower in the pipeline).
97 void tri_triangle( struct tri_context
*tri
,
98 const struct vertex
*v0
,
99 const struct vertex
*v1
,
100 const struct vertex
*v2
);
102 /* TODO: rasterize_line, rasterize_point??
103 * How will linestipple work?
109 GLboolean
tri_setup( struct tri_context
*tri
,
110 const struct vertex
*v0
,
111 const struct vertex
*v1
,
112 const struct vertex
*v2
);
114 void tri_rasterize( struct tri_context
*tri
);
115 void tri_rasterize_spans( struct tri_context
*tri
);
122 #endif /* SP_PRIM_SETUP_H */