00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef DRAW_PT_H
00034 #define DRAW_PT_H
00035
00036 #include "pipe/p_compiler.h"
00037
00038 typedef unsigned (*pt_elt_func)( const void *elts, unsigned idx );
00039
00040 struct draw_pt_middle_end;
00041 struct draw_context;
00042
00043
00044 #define PT_SHADE 0x1
00045 #define PT_CLIPTEST 0x2
00046 #define PT_PIPELINE 0x4
00047 #define PT_MAX_MIDDLE 0x8
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 struct draw_pt_front_end {
00062 void (*prepare)( struct draw_pt_front_end *,
00063 unsigned prim,
00064 struct draw_pt_middle_end *,
00065 unsigned opt );
00066
00067 void (*run)( struct draw_pt_front_end *,
00068 pt_elt_func elt_func,
00069 const void *elt_ptr,
00070 unsigned count );
00071
00072 void (*finish)( struct draw_pt_front_end * );
00073 void (*destroy)( struct draw_pt_front_end * );
00074 };
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 struct draw_pt_middle_end {
00085 void (*prepare)( struct draw_pt_middle_end *,
00086 unsigned prim,
00087 unsigned opt,
00088 unsigned *max_vertices );
00089
00090 void (*run)( struct draw_pt_middle_end *,
00091 const unsigned *fetch_elts,
00092 unsigned fetch_count,
00093 const ushort *draw_elts,
00094 unsigned draw_count );
00095
00096 void (*run_linear)(struct draw_pt_middle_end *,
00097 unsigned start,
00098 unsigned count);
00099
00100
00101
00102
00103 boolean (*run_linear_elts)( struct draw_pt_middle_end *,
00104 unsigned fetch_start,
00105 unsigned fetch_count,
00106 const ushort *draw_elts,
00107 unsigned draw_count );
00108
00109 int (*get_max_vertex_count)( struct draw_pt_middle_end * );
00110
00111 void (*finish)( struct draw_pt_middle_end * );
00112 void (*destroy)( struct draw_pt_middle_end * );
00113 };
00114
00115
00116
00117
00118 struct vbuf_render;
00119 struct vertex_header;
00120
00121
00122
00123
00124 pt_elt_func draw_pt_elt_func( struct draw_context *draw );
00125 const void *draw_pt_elt_ptr( struct draw_context *draw,
00126 unsigned start );
00127
00128
00129
00130
00131
00132
00133 struct draw_pt_front_end *draw_pt_vcache( struct draw_context *draw );
00134 struct draw_pt_front_end *draw_pt_varray(struct draw_context *draw);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 struct draw_pt_middle_end *draw_pt_fetch_emit( struct draw_context *draw );
00148 struct draw_pt_middle_end *draw_pt_middle_fse( struct draw_context *draw );
00149 struct draw_pt_middle_end *draw_pt_fetch_pipeline_or_emit(struct draw_context *draw);
00150
00151
00152
00153
00154 boolean draw_pt_get_edgeflag( struct draw_context *draw,
00155 unsigned idx );
00156
00157
00158
00159
00160
00161 struct pt_emit;
00162
00163 void draw_pt_emit_prepare( struct pt_emit *emit,
00164 unsigned prim,
00165 unsigned *max_vertices );
00166
00167 void draw_pt_emit( struct pt_emit *emit,
00168 const float (*vertex_data)[4],
00169 unsigned vertex_count,
00170 unsigned stride,
00171 const ushort *elts,
00172 unsigned count );
00173
00174 void draw_pt_emit_linear( struct pt_emit *emit,
00175 const float (*vertex_data)[4],
00176 unsigned vertex_count,
00177 unsigned stride,
00178 unsigned start,
00179 unsigned count );
00180
00181 void draw_pt_emit_destroy( struct pt_emit *emit );
00182
00183 struct pt_emit *draw_pt_emit_create( struct draw_context *draw );
00184
00185
00186
00187
00188
00189
00190 struct pt_fetch;
00191 void draw_pt_fetch_prepare( struct pt_fetch *fetch,
00192 unsigned vertex_size );
00193
00194 void draw_pt_fetch_run( struct pt_fetch *fetch,
00195 const unsigned *elts,
00196 unsigned count,
00197 char *verts );
00198
00199 void draw_pt_fetch_run_linear( struct pt_fetch *fetch,
00200 unsigned start,
00201 unsigned count,
00202 char *verts );
00203
00204 void draw_pt_fetch_destroy( struct pt_fetch *fetch );
00205
00206 struct pt_fetch *draw_pt_fetch_create( struct draw_context *draw );
00207
00208
00209
00210
00211 struct pt_post_vs;
00212
00213 boolean draw_pt_post_vs_run( struct pt_post_vs *pvs,
00214 struct vertex_header *pipeline_verts,
00215 unsigned stride,
00216 unsigned count );
00217
00218 void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
00219 boolean bypass_clipping,
00220 boolean identity_viewport,
00221 boolean opengl );
00222
00223 struct pt_post_vs *draw_pt_post_vs_create( struct draw_context *draw );
00224
00225 void draw_pt_post_vs_destroy( struct pt_post_vs *pvs );
00226
00227
00228
00229
00230
00231 void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr);
00232 unsigned draw_pt_reduced_prim(unsigned prim);
00233
00234
00235 #endif