llvmpipe: Do not use barriers if not using threads.
authorVinson Lee <vlee@freedesktop.org>
Thu, 11 Feb 2016 00:42:19 +0000 (16:42 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sat, 13 Feb 2016 22:42:05 +0000 (14:42 -0800)
Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94088
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/llvmpipe/lp_rast.c

index d22e50777fa0a4e86458f4725dc8f43514e18f5f..9e56c962d2d4fcc335ae367b849b26b064798f3a 100644 (file)
@@ -910,7 +910,9 @@ lp_rast_create( unsigned num_threads )
    create_rast_threads(rast);
 
    /* for synchronizing rasterization threads */
-   pipe_barrier_init( &rast->barrier, rast->num_threads );
+   if (rast->num_threads > 0) {
+      pipe_barrier_init( &rast->barrier, rast->num_threads );
+   }
 
    memset(lp_dummy_tile, 0, sizeof lp_dummy_tile);
 
@@ -967,7 +969,9 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
    }
 
    /* for synchronizing rasterization threads */
-   pipe_barrier_destroy( &rast->barrier );
+   if (rast->num_threads > 0) {
+      pipe_barrier_destroy( &rast->barrier );
+   }
 
    lp_scene_queue_destroy(rast->full_scenes);