gallium: call tgsi_set_exec_mask() and use exec mask in SSE ARL code
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_stipple.c
index 4673d5dcbae8bb64453c1f40a132575c00103133..b65e2aa10211beb748f946c82db5e6a682fbbd68 100644 (file)
  */
 
 
-#include "pipe/p_util.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_shader_tokens.h"
-#include "draw_pipe.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
+
+#include "draw/draw_pipe.h"
 
 
 /** Subclass of draw_stage */
@@ -119,8 +121,9 @@ stipple_line(struct draw_stage *stage, struct prim_header *header)
    struct stipple_stage *stipple = stipple_stage(stage);
    struct vertex_header *v0 = header->v[0];
    struct vertex_header *v1 = header->v[1];
-   const float *pos0 = v0->data[0];
-   const float *pos1 = v1->data[0];
+   const unsigned pos = stage->draw->vs.position_output;
+   const float *pos0 = v0->data[pos];
+   const float *pos1 = v1->data[pos];
    float start = 0;
    int state = 0;
 
@@ -175,6 +178,22 @@ reset_stipple_counter(struct draw_stage *stage)
    stage->next->reset_stipple_counter( stage->next );
 }
 
+static void
+stipple_reset_point(struct draw_stage *stage, struct prim_header *header)
+{
+   struct stipple_stage *stipple = stipple_stage(stage);
+   stipple->counter = 0;
+   stage->next->point(stage->next, header);
+}
+
+static void
+stipple_reset_tri(struct draw_stage *stage, struct prim_header *header)
+{
+   struct stipple_stage *stipple = stipple_stage(stage);
+   stipple->counter = 0;
+   stage->next->tri(stage->next, header);
+}
+
 
 static void
 stipple_first_line(struct draw_stage *stage, 
@@ -220,9 +239,9 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw )
 
    stipple->stage.draw = draw;
    stipple->stage.next = NULL;
-   stipple->stage.point = draw_pipe_passthrough_point;
+   stipple->stage.point = stipple_reset_point;
    stipple->stage.line = stipple_first_line;
-   stipple->stage.tri = draw_pipe_passthrough_tri;
+   stipple->stage.tri = stipple_reset_tri;
    stipple->stage.reset_stipple_counter = reset_stipple_counter;
    stipple->stage.flush = stipple_flush;
    stipple->stage.destroy = stipple_destroy;