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_PIPE_H
00034 #define DRAW_PIPE_H
00035
00036 #include "pipe/p_compiler.h"
00037 #include "draw_private.h"
00038
00039
00043 struct prim_header {
00044 float det;
00045 ushort flags;
00046 ushort pad;
00047 struct vertex_header *v[3];
00048 };
00049
00050
00051
00055 struct draw_stage
00056 {
00057 struct draw_context *draw;
00059 struct draw_stage *next;
00061 struct vertex_header **tmp;
00062 unsigned nr_tmps;
00063
00064 void (*point)( struct draw_stage *,
00065 struct prim_header * );
00066
00067 void (*line)( struct draw_stage *,
00068 struct prim_header * );
00069
00070 void (*tri)( struct draw_stage *,
00071 struct prim_header * );
00072
00073 void (*flush)( struct draw_stage *,
00074 unsigned flags );
00075
00076 void (*reset_stipple_counter)( struct draw_stage * );
00077
00078 void (*destroy)( struct draw_stage * );
00079 };
00080
00081
00082 extern struct draw_stage *draw_unfilled_stage( struct draw_context *context );
00083 extern struct draw_stage *draw_twoside_stage( struct draw_context *context );
00084 extern struct draw_stage *draw_offset_stage( struct draw_context *context );
00085 extern struct draw_stage *draw_clip_stage( struct draw_context *context );
00086 extern struct draw_stage *draw_flatshade_stage( struct draw_context *context );
00087 extern struct draw_stage *draw_cull_stage( struct draw_context *context );
00088 extern struct draw_stage *draw_stipple_stage( struct draw_context *context );
00089 extern struct draw_stage *draw_wide_line_stage( struct draw_context *context );
00090 extern struct draw_stage *draw_wide_point_stage( struct draw_context *context );
00091 extern struct draw_stage *draw_validate_stage( struct draw_context *context );
00092
00093
00094 extern void draw_free_temp_verts( struct draw_stage *stage );
00095 extern boolean draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr );
00096
00097 extern void draw_reset_vertex_ids( struct draw_context *draw );
00098
00099 void draw_pipe_passthrough_tri(struct draw_stage *stage, struct prim_header *header);
00100 void draw_pipe_passthrough_line(struct draw_stage *stage, struct prim_header *header);
00101 void draw_pipe_passthrough_point(struct draw_stage *stage, struct prim_header *header);
00102
00103
00104
00112 static INLINE struct vertex_header *
00113 dup_vert( struct draw_stage *stage,
00114 const struct vertex_header *vert,
00115 unsigned idx )
00116 {
00117 struct vertex_header *tmp = stage->tmp[idx];
00118 const uint vsize = sizeof(struct vertex_header)
00119 + stage->draw->vs.num_vs_outputs * 4 * sizeof(float);
00120 memcpy(tmp, vert, vsize);
00121 tmp->vertex_id = UNDEFINED_VERTEX_ID;
00122 return tmp;
00123 }
00124
00125 #endif