/* Originally written by Ben Skeggs for the nv50 driver*/
-#include <pipe/p_defines.h>
+
+#ifndef U_SPLIT_PRIM_H
+#define U_SPLIT_PRIM_H
+
+#include "pipe/p_defines.h"
+#include "pipe/p_compiler.h"
+
+#include "util/u_debug.h"
struct util_split_prim {
void *priv;
uint edgeflag_off:1;
};
-static INLINE void
+static inline void
util_split_prim_init(struct util_split_prim *s,
unsigned mode, unsigned start, unsigned count)
{
s->repeat_first = 0;
}
-static INLINE boolean
+static inline boolean
util_split_prim_next(struct util_split_prim *s, unsigned max_verts)
{
int repeat = 0;
}
}
- if (s->p_start + s->close_first + max_verts >= s->p_end) {
+ if ((s->p_end - s->p_start) + s->close_first <= max_verts) {
s->emit(s->priv, s->p_start, s->p_end - s->p_start);
if (s->close_first)
s->emit(s->priv, s->start, 1);
s->p_start += (max_verts - repeat);
return FALSE;
}
+
+#endif /* U_SPLIT_PRIM_H */