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 **************************************************************************/
30 * Keith Whitwell <keith@tungstengraphics.com>
36 #include "pipe/p_compiler.h"
38 typedef unsigned (*pt_elt_func
)( const void *elts
, unsigned idx
);
40 struct draw_pt_middle_end
;
43 /* The "front end" - prepare sets of fetch, draw elements for the
46 * Currenly one version of this:
47 * - vcache - catchall implementation, decomposes to TRI/LINE/POINT prims
49 * - varray, varray_split
50 * - velement, velement_split
52 * Currenly only using the vcache version.
54 struct draw_pt_front_end
{
55 void (*prepare
)( struct draw_pt_front_end
*,
56 struct draw_pt_middle_end
* );
58 void (*run
)( struct draw_pt_front_end
*,
64 void (*finish
)( struct draw_pt_front_end
* );
65 void (*destroy
)( struct draw_pt_front_end
* );
69 /* The "middle end" - prepares actual hardware vertices for the
72 * Currently two versions of this:
73 * - fetch, vertex shade, cliptest, prim-pipeline
74 * - fetch, emit (ie passthrough)
76 * - fetch, vertex shade, cliptest, maybe-pipeline, maybe-emit
77 * - fetch, vertex shade, emit
79 * Currenly only using the passthrough version.
81 struct draw_pt_middle_end
{
82 void (*prepare
)( struct draw_pt_middle_end
* );
84 void (*run
)( struct draw_pt_middle_end
*,
86 const unsigned *fetch_elts
,
88 const ushort
*draw_elts
,
89 unsigned draw_count
);
91 void (*finish
)( struct draw_pt_middle_end
* );
92 void (*destroy
)( struct draw_pt_middle_end
* );
96 /* The "back end" - supplied by the driver, defined in draw_vbuf.h.
98 * Not sure whether to wrap the prim pipeline up as an alternate
99 * backend. Would be a win for everything except pure passthrough
107 pt_elt_func
draw_pt_elt_func( struct draw_context
*draw
);
108 const void *draw_pt_elt_ptr( struct draw_context
*draw
,
113 struct draw_pt_front_end
*draw_pt_vcache( struct draw_context
*draw
);
114 struct draw_pt_middle_end
*draw_pt_fetch_emit( struct draw_context
*draw
);