};
/* these flags are set if the primitive is a segment of a larger one */
-#define DRAW_SPLIT_BEFORE 0x1
-#define DRAW_SPLIT_AFTER 0x2
+#define DRAW_SPLIT_BEFORE 0x1
+#define DRAW_SPLIT_AFTER 0x2
+#define DRAW_LINE_LOOP_AS_STRIP 0x4
struct draw_prim_info {
boolean linear;
}
+static inline unsigned
+prim_type(unsigned prim, unsigned flags)
+{
+ if (flags & DRAW_LINE_LOOP_AS_STRIP)
+ return PIPE_PRIM_LINE_STRIP;
+ else
+ return prim;
+}
+
+
static void
fetch_pipeline_run(struct draw_pt_middle_end *middle,
const unsigned *fetch_elts,
prim_info.start = 0;
prim_info.count = draw_count;
prim_info.elts = draw_elts;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &draw_count;
prim_info.start = 0;
prim_info.count = count;
prim_info.elts = NULL;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &count;
prim_info.start = 0;
prim_info.count = draw_count;
prim_info.elts = draw_elts;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &draw_count;
}
+static inline unsigned
+prim_type(unsigned prim, unsigned flags)
+{
+ if (flags & DRAW_LINE_LOOP_AS_STRIP)
+ return PIPE_PRIM_LINE_STRIP;
+ else
+ return prim;
+}
+
+
static void
llvm_middle_end_run(struct draw_pt_middle_end *middle,
const unsigned *fetch_elts,
prim_info.start = 0;
prim_info.count = draw_count;
prim_info.elts = draw_elts;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &draw_count;
prim_info.start = 0;
prim_info.count = count;
prim_info.elts = NULL;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &count;
prim_info.start = 0;
prim_info.count = draw_count;
prim_info.elts = draw_elts;
- prim_info.prim = fpme->input_prim;
+ prim_info.prim = prim_type(fpme->input_prim, prim_flags);
prim_info.flags = prim_flags;
prim_info.primitive_count = 1;
prim_info.primitive_lengths = &draw_count;
assert(icount + !!close_loop <= vsplit->segment_size);
+ /* need to draw the sections of the line loop as line strips */
+ flags |= DRAW_LINE_LOOP_AS_STRIP;
+
if (close_loop) {
for (nr = 0; nr < icount; nr++)
vsplit->fetch_elts[nr] = istart + nr;