[Mesa-dev] [PATCH] llvmpipe: fix the LP_NO_RAST debug option
Jose Fonseca
jfonseca at vmware.com
Mon Jun 25 05:53:24 PDT 2012
Looks good to me.
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Jose
----- Original Message -----
> It was only no-oping the clear() function, not actual triangle
> rasterization. Move the no_rast field from lp_context down into
> lp_rasterizer so it's accessible where it's needed.
> ---
> src/gallium/drivers/llvmpipe/lp_clear.c | 3 --
> src/gallium/drivers/llvmpipe/lp_context.c | 6 ----
> src/gallium/drivers/llvmpipe/lp_rast.c | 36
> +++++++++++++++-----------
> src/gallium/drivers/llvmpipe/lp_rast_priv.h | 1 +
> 4 files changed, 22 insertions(+), 24 deletions(-)
>
> diff --git a/src/gallium/drivers/llvmpipe/lp_clear.c
> b/src/gallium/drivers/llvmpipe/lp_clear.c
> index 0b37347..cc90dc4 100644
> --- a/src/gallium/drivers/llvmpipe/lp_clear.c
> +++ b/src/gallium/drivers/llvmpipe/lp_clear.c
> @@ -53,9 +53,6 @@ llvmpipe_clear(struct pipe_context *pipe,
> {
> struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
>
> - if (llvmpipe->no_rast)
> - return;
> -
> if (!llvmpipe_check_render_cond(llvmpipe))
> return;
>
> diff --git a/src/gallium/drivers/llvmpipe/lp_context.c
> b/src/gallium/drivers/llvmpipe/lp_context.c
> index 8c0206b..7f92a5f 100644
> --- a/src/gallium/drivers/llvmpipe/lp_context.c
> +++ b/src/gallium/drivers/llvmpipe/lp_context.c
> @@ -47,9 +47,6 @@
> #include "lp_setup.h"
>
>
> -DEBUG_GET_ONCE_BOOL_OPTION(lp_no_rast, "LP_NO_RAST", FALSE)
> -
> -
> /** shared by all contexts */
> unsigned llvmpipe_variant_count;
>
> @@ -207,9 +204,6 @@ llvmpipe_create_context( struct pipe_screen
> *screen, void *priv )
>
> /* FIXME: devise alternative to draw_texture_samplers */
>
> - if (debug_get_option_lp_no_rast())
> - llvmpipe->no_rast = TRUE;
> -
> llvmpipe->setup = lp_setup_create( &llvmpipe->pipe,
> llvmpipe->draw );
> if (!llvmpipe->setup)
> diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c
> b/src/gallium/drivers/llvmpipe/lp_rast.c
> index efa5024..7e94055 100644
> --- a/src/gallium/drivers/llvmpipe/lp_rast.c
> +++ b/src/gallium/drivers/llvmpipe/lp_rast.c
> @@ -701,28 +701,32 @@ rasterize_scene(struct lp_rasterizer_task
> *task,
> struct lp_scene *scene)
> {
> task->scene = scene;
> - /* loop over scene bins, rasterize each */
> +
> + if (!task->rast->no_rast) {
> + /* loop over scene bins, rasterize each */
> #if 0
> - {
> - unsigned i, j;
> - for (i = 0; i < scene->tiles_x; i++) {
> - for (j = 0; j < scene->tiles_y; j++) {
> - struct cmd_bin *bin = lp_scene_get_bin(scene, i, j);
> - rasterize_bin(task, bin, i, j);
> + {
> + unsigned i, j;
> + for (i = 0; i < scene->tiles_x; i++) {
> + for (j = 0; j < scene->tiles_y; j++) {
> + struct cmd_bin *bin = lp_scene_get_bin(scene, i, j);
> + rasterize_bin(task, bin, i, j);
> + }
> }
> }
> - }
> #else
> - {
> - struct cmd_bin *bin;
> + {
> + struct cmd_bin *bin;
>
> - assert(scene);
> - while ((bin = lp_scene_bin_iter_next(scene))) {
> - if (!is_empty_bin( bin ))
> - rasterize_bin(task, bin);
> + assert(scene);
> + while ((bin = lp_scene_bin_iter_next(scene))) {
> + if (!is_empty_bin( bin ))
> + rasterize_bin(task, bin);
> + }
> }
> - }
> #endif
> + }
> +
>
> if (scene->fence) {
> lp_fence_signal(scene->fence);
> @@ -896,6 +900,8 @@ lp_rast_create( unsigned num_threads )
>
> rast->num_threads = num_threads;
>
> + rast->no_rast = debug_get_bool_option("LP_NO_RAST", FALSE);
> +
> create_rast_threads(rast);
>
> /* for synchronizing rasterization threads */
> diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
> b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
> index d0bda35..b5d0074 100644
> --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
> +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
> @@ -111,6 +111,7 @@ struct lp_rasterizer_task
> struct lp_rasterizer
> {
> boolean exit_flag;
> + boolean no_rast; /**< For debugging/profiling */
>
> /** The incoming queue of scenes ready to rasterize */
> struct lp_scene_queue *full_scenes;
> --
> 1.7.3.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list