1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
29 #ifndef SP_PRIM_SETUP_H
30 #define SP_PRIM_SETUP_H
34 * vbuf is a special stage to gather the stream of triangles, lines, points
35 * together and reconstruct vertex buffers for hardware upload.
37 * First attempt, work in progress.
40 * - separate out vertex buffer building and primitive emit, ie >1 draw per vb.
41 * - tell vbuf stage how to build hw vertices directly
42 * - pass vbuf stage a buffer pointer for direct emit to agp/vram.
46 * Vertices are just an array of floats, with all the attributes
47 * packed. We currently assume a layout like:
49 * attr[0][0..3] - window position
50 * attr[1..n][0..3] - remaining attributes.
52 * Attributes are assumed to be 4 floats wide but are packed so that
53 * all the enabled attributes run contiguously.
58 struct softpipe_context
;
61 typedef void (*vbuf_draw_func
)( struct pipe_context
*pipe
,
63 const ushort
*elements
,
65 const void *vertex_buffer
,
66 unsigned nr_vertices
);
69 extern struct draw_stage
*
70 sp_draw_render_stage( struct softpipe_context
*softpipe
);
72 extern struct setup_context
*
73 sp_draw_setup_context( struct draw_stage
* );
76 sp_draw_flush( struct draw_stage
* );
79 extern struct draw_stage
*
80 sp_draw_vbuf_stage( struct draw_context
*draw_context
,
81 struct pipe_context
*pipe
,
82 vbuf_draw_func draw
);
85 #endif /* SP_PRIM_SETUP_H */