OSDN Git Service

gallium: added draw_enable_line_stipple() function
authorBrian <brian.paul@tungstengraphics.com>
Thu, 13 Mar 2008 20:33:57 +0000 (14:33 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 13 Mar 2008 20:33:57 +0000 (14:33 -0600)
Allows drivers that implement line stipple to turn off this drawing stage.

src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_context.h
src/gallium/auxiliary/draw/draw_private.h

index fed2b6e..3d09d95 100644 (file)
@@ -85,6 +85,7 @@ struct draw_context *draw_create( void )
    /* these defaults are oriented toward the needs of softpipe */
    draw->wide_point_threshold = 1000000.0; /* infinity */
    draw->wide_line_threshold = 1.0;
+   draw->line_stipple = TRUE;
 
    draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */
 
@@ -255,6 +256,17 @@ draw_wide_line_threshold(struct draw_context *draw, float threshold)
 
 
 /**
+ * Tells the draw module whether or not to implement line stipple.
+ */
+void
+draw_enable_line_stipple(struct draw_context *draw, boolean enable)
+{
+   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+   draw->line_stipple = enable;
+}
+
+
+/**
  * Ask the draw module for the location/slot of the given vertex attribute in
  * a post-transformed vertex.
  *
index df63e91..e8e2b56 100644 (file)
@@ -94,6 +94,9 @@ void draw_wide_point_threshold(struct draw_context *draw, float threshold);
 
 void draw_wide_line_threshold(struct draw_context *draw, float threshold);
 
+void draw_enable_line_stipple(struct draw_context *draw, boolean enable);
+
+
 boolean draw_use_sse(struct draw_context *draw);
 
 void
index 4147472..379b6c3 100644 (file)
@@ -238,6 +238,7 @@ struct draw_context
 
    float wide_point_threshold; /**< convert pnts to tris if larger than this */
    float wide_line_threshold;  /**< convert lines to tris if wider than this */
+   boolean line_stipple;       /**< do line stipple? */
    boolean use_sse;
 
    /* If a prim stage introduces new vertex attributes, they'll be stored here
@@ -344,10 +345,10 @@ extern void draw_vertex_cache_reset_vertex_ids( struct draw_context *draw );
 
 extern void draw_vertex_shader_queue_flush( struct draw_context *draw );
 
-struct tgsi_exec_machine;
-
 extern void draw_update_vertex_fetch( struct draw_context *draw );
 
+extern boolean draw_need_pipeline(const struct draw_context *draw);
+
 
 /* Prototype/hack
  */