X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_clear.c;h=dd6bd833e61a31aa90f134d8eb97bd31e776a7fd;hb=23e4fe2a5310021dc522465cd9d0939117e2b641;hp=8fac8e6e05ffd528510f699f6f4b6a5c50be9854;hpb=3d36d6b4cf735e93a6ae5eadf28e671252fb5303;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c index 8fac8e6e05f..dd6bd833e61 100644 --- a/src/gallium/drivers/softpipe/sp_clear.c +++ b/src/gallium/drivers/softpipe/sp_clear.c @@ -36,6 +36,7 @@ #include "util/u_pack_color.h" #include "sp_clear.h" #include "sp_context.h" +#include "sp_query.h" #include "sp_tile_cache.h" @@ -44,45 +45,36 @@ * No masking, no scissor (clear entire buffer). */ void -softpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, +softpipe_clear(struct pipe_context *pipe, unsigned buffers, + const union pipe_color_union *color, double depth, unsigned stencil) { struct softpipe_context *softpipe = softpipe_context(pipe); - unsigned cv; + uint64_t cv; uint i; if (softpipe->no_rast) return; + if (!softpipe_check_render_cond(softpipe)) + return; + #if 0 - softpipe_update_derived(softpipe); /* not needed?? */ + softpipe_update_derived(softpipe, PIPE_PRIM_TRIANGLES); /* not needed?? */ #endif if (buffers & PIPE_CLEAR_COLOR) { for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) { - struct pipe_surface *ps = softpipe->framebuffer.cbufs[i]; - - util_pack_color(rgba, ps->format, &cv); - sp_tile_cache_clear(softpipe->cbuf_cache[i], rgba, cv); - -#if !TILE_CLEAR_OPTIMIZATION - /* non-cached surface */ - pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv); -#endif + sp_tile_cache_clear(softpipe->cbuf_cache[i], color, 0); } } if (buffers & PIPE_CLEAR_DEPTHSTENCIL) { - static const float zero[4] = { 0.0F, 0.0F, 0.0F, 0.0F }; + static const union pipe_color_union zero; struct pipe_surface *ps = softpipe->framebuffer.zsbuf; - cv = util_pack_z_stencil(ps->format, depth, stencil); - sp_tile_cache_clear(softpipe->zsbuf_cache, zero, cv); - -#if !TILE_CLEAR_OPTIMIZATION - /* non-cached surface */ - pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv); -#endif + cv = util_pack64_z_stencil(ps->format, depth, stencil); + sp_tile_cache_clear(softpipe->zsbuf_cache, &zero, cv); } softpipe->dirty_render_cache = TRUE;