Skip to content

Commit

Permalink
llvmpipe: asst. clean-ups in lp_state_surface.c
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
  • Loading branch information
brianpaul authored and Marge Bot committed Oct 25, 2022
1 parent 47fa82d commit 03bd429
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/gallium/drivers/llvmpipe/lp_state_surface.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************
*
*
* Copyright 2007 VMware, Inc.
* All Rights Reserved.
*
Expand All @@ -10,19 +10,19 @@
* 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.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* 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.
*
*
**************************************************************************/

/* Authors: Keith Whitwell <keithw@vmware.com>
Expand Down Expand Up @@ -52,7 +52,6 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
struct llvmpipe_context *lp = llvmpipe_context(pipe);

boolean changed = !util_framebuffer_state_equal(&lp->framebuffer, fb);
unsigned i;

assert(fb->width <= LP_MAX_WIDTH);
assert(fb->height <= LP_MAX_HEIGHT);
Expand All @@ -61,7 +60,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
/*
* If no depth buffer is bound, send the utility function the default
* format for no bound depth (PIPE_FORMAT_NONE).
*/
*/
enum pipe_format depth_format = fb->zsbuf ?
fb->zsbuf->format : PIPE_FORMAT_NONE;
const struct util_format_description *depth_desc =
Expand All @@ -71,7 +70,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
debug_printf("Illegal setting of fb state with zsbuf created in "
"another context\n");
}
for (i = 0; i < fb->nr_cbufs; i++) {
for (unsigned i = 0; i < fb->nr_cbufs; i++) {
if (fb->cbufs[i] &&
fb->cbufs[i]->context != pipe) {
debug_printf("Illegal setting of fb state with cbuf %d created in "
Expand All @@ -91,13 +90,13 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
*/
lp->floating_point_depth =
(util_get_depth_format_type(depth_desc) == UTIL_FORMAT_TYPE_FLOAT);

lp->mrd = util_get_depth_format_mrd(depth_desc);

/* Tell the draw module how deep the Z/depth buffer is. */
draw_set_zs_format(lp->draw, depth_format);

lp_setup_bind_framebuffer( lp->setup, &lp->framebuffer );
lp_setup_bind_framebuffer(lp->setup, &lp->framebuffer);

lp->dirty |= LP_NEW_FRAMEBUFFER;
}
Expand Down

0 comments on commit 03bd429

Please sign in to comment.