From c2271fb78783c5be26b7956b3579b4bc702e870b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Sep 2022 11:30:12 -0600 Subject: [PATCH] llvmpipe: asst. clean-ups in lp_state_rasterizer.c Signed-off-by: Brian Paul Part-of: --- .../drivers/llvmpipe/lp_state_rasterizer.c | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c index 80f7a08d8de..0b6959e4e88 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c +++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #include "pipe/p_defines.h" @@ -32,11 +32,13 @@ #include "lp_setup.h" #include "draw/draw_context.h" + struct lp_rasterizer_state { struct pipe_rasterizer_state lp_state; struct pipe_rasterizer_state draw_state; }; + /* State which might be handled in either the draw module or locally. * This function is used to turn that state off in one of the two * places. @@ -53,7 +55,6 @@ clear_flags(struct pipe_rasterizer_state *rast) } - static void * llvmpipe_create_rasterizer_state(struct pipe_context *pipe, const struct pipe_rasterizer_state *rast) @@ -72,16 +73,16 @@ llvmpipe_create_rasterizer_state(struct pipe_context *pipe, /* We rely on draw module to do unfilled polygons, AA lines and * points and stipple. - * + * * Over time, reduce this list of conditions, and expand the list * of flags which get cleared in clear_flags(). */ need_pipeline = (rast->fill_front != PIPE_POLYGON_MODE_FILL || - rast->fill_back != PIPE_POLYGON_MODE_FILL || - rast->point_smooth || - rast->line_smooth || - rast->line_stipple_enable || - rast->poly_stipple_enable); + rast->fill_back != PIPE_POLYGON_MODE_FILL || + rast->point_smooth || + rast->line_smooth || + rast->line_stipple_enable || + rast->poly_stipple_enable); /* If not using the pipeline, clear out the flags which we can * handle ourselves. If we *are* using the pipeline, do everything @@ -97,7 +98,6 @@ llvmpipe_create_rasterizer_state(struct pipe_context *pipe, } - static void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle) { @@ -108,11 +108,10 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle) if (state) { llvmpipe->rasterizer = &state->lp_state; draw_set_rasterizer_state(llvmpipe->draw, &state->draw_state, handle); - lp_setup_bind_rasterizer( llvmpipe->setup, &state->lp_state); - } - else { + lp_setup_bind_rasterizer(llvmpipe->setup, &state->lp_state); + } else { llvmpipe->rasterizer = NULL; - draw_set_rasterizer_state(llvmpipe->draw, NULL, handle); + draw_set_rasterizer_state(llvmpipe->draw, NULL, handle); } llvmpipe->dirty |= LP_NEW_RASTERIZER; @@ -123,11 +122,10 @@ static void llvmpipe_delete_rasterizer_state(struct pipe_context *pipe, void *rasterizer) { - FREE( rasterizer ); + FREE(rasterizer); } - void llvmpipe_init_rasterizer_funcs(struct llvmpipe_context *llvmpipe) {