Path: blob/21.2-virgl/src/gallium/drivers/llvmpipe/lp_clear.c
4570 views
/**************************************************************************1*2* Copyright 2007 VMware, Inc.3* All Rights Reserved.4* Copyright 2009 VMware, Inc. All Rights Reserved.5*6* Permission is hereby granted, free of charge, to any person obtaining a7* copy of this software and associated documentation files (the8* "Software"), to deal in the Software without restriction, including9* without limitation the rights to use, copy, modify, merge, publish,10* distribute, sub license, and/or sell copies of the Software, and to11* permit persons to whom the Software is furnished to do so, subject to12* the following conditions:13*14* The above copyright notice and this permission notice (including the15* next paragraph) shall be included in all copies or substantial portions16* of the Software.17*18* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS19* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF20* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.21* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR22* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,23* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE24* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.25*26**************************************************************************/2728/* Author:29* Brian Paul30* Michel Dänzer31*/323334#include "pipe/p_defines.h"35#include "lp_clear.h"36#include "lp_context.h"37#include "lp_setup.h"38#include "lp_query.h"39#include "lp_debug.h"404142/**43* Clear the given buffers to the specified values.44* No masking, no scissor (clear entire buffer).45*/46void47llvmpipe_clear(struct pipe_context *pipe,48unsigned buffers,49const struct pipe_scissor_state *scissor_state,50const union pipe_color_union *color,51double depth,52unsigned stencil)53{54struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);5556if (!llvmpipe_check_render_cond(llvmpipe))57return;5859if (LP_PERF & PERF_NO_DEPTH)60buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;6162lp_setup_clear( llvmpipe->setup, color, depth, stencil, buffers );63}646566