draw: hide passthrough shading paths behind an environment variable
authorKeith Whitwell <keith@tungstengraphics.com>
Mon, 14 Apr 2008 11:08:46 +0000 (12:08 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 14 Apr 2008 11:08:46 +0000 (12:08 +0100)
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/draw/draw_pt.c

index cdca556fbdf49f8a91b7f25c2ac9a45249b0d723..1e70a7752336727dbb9c65ffdd17d0a3b42541ee 100644 (file)
@@ -49,6 +49,8 @@ struct draw_context *draw_create( void )
    draw->use_sse = FALSE;
 #endif
 
+   draw->use_pt_shaders = GETENV( "GALLIUM_PT_SHADERS" ) != NULL;
+
    /* create pipeline stages */
    draw->pipeline.wide_line  = draw_wide_line_stage( draw );
    draw->pipeline.wide_point = draw_wide_point_stage( draw );
index 1115166192e10dd061e2b91a2c038463e3f870ba..3042d26847996bcfb85d4641463d8f4b43d8fdca 100644 (file)
@@ -276,6 +276,7 @@ struct draw_context
    boolean line_stipple;       /**< do line stipple? */
    boolean point_sprite;       /**< convert points to quads for sprites? */
    boolean use_sse;
+   boolean use_pt_shaders;     /* temporary flag to switch on pt shader paths */
 
    /* If a prim stage introduces new vertex attributes, they'll be stored here
     */
index c8663c0e844a2095621476ac72479a949ba8598a..c67a217982025a7e5868bf51a18d0ee4b166579d 100644 (file)
@@ -79,6 +79,9 @@ draw_pt_arrays(struct draw_context *draw,
     *     - backend  -- the vbuf_render provided by the driver.
     */
 
+   if (shading && !draw->use_pt_shaders)
+      return FALSE;
+
 
    if (!cliptest && !pipeline && !shading) {
       /* This is the 'passthrough' path: