diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-03-13 14:33:57 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-03-13 14:33:57 -0600 |
commit | 8b8c9acdb747499149e633179a8ad10b0e4206b1 (patch) | |
tree | c630f1b7035a62fef3fc8167baabc97917798105 /src/gallium | |
parent | b6ed165748c6585f1368be37c0d0289cead419c9 (diff) |
gallium: added draw_enable_line_stipple() function
Allows drivers that implement line stipple to turn off this drawing stage.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.h | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/draw/draw_private.h | 5 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index fed2b6e759..3d09d95851 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -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. * diff --git a/src/gallium/auxiliary/draw/draw_context.h b/src/gallium/auxiliary/draw/draw_context.h index df63e91a22..e8e2b56bae 100644 --- a/src/gallium/auxiliary/draw/draw_context.h +++ b/src/gallium/auxiliary/draw/draw_context.h @@ -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 diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 4147472d45..379b6c3206 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -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 */ |