llvmpipe: rewrite llvmpipe_clear()
This commit is contained in:
parent
931210424b
commit
d2e2b75633
|
@ -33,12 +33,10 @@
|
||||||
|
|
||||||
|
|
||||||
#include "pipe/p_defines.h"
|
#include "pipe/p_defines.h"
|
||||||
#include "util/u_pack_color.h"
|
|
||||||
#include "lp_clear.h"
|
#include "lp_clear.h"
|
||||||
#include "lp_context.h"
|
#include "lp_context.h"
|
||||||
#include "lp_surface.h"
|
#include "lp_setup.h"
|
||||||
#include "lp_state.h"
|
#include "lp_state.h"
|
||||||
#include "lp_tile_cache.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,36 +44,16 @@
|
||||||
* No masking, no scissor (clear entire buffer).
|
* No masking, no scissor (clear entire buffer).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
llvmpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba,
|
llvmpipe_clear(struct pipe_context *pipe,
|
||||||
double depth, unsigned stencil)
|
unsigned buffers,
|
||||||
|
const float *rgba,
|
||||||
|
double depth,
|
||||||
|
unsigned stencil)
|
||||||
{
|
{
|
||||||
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
|
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
|
||||||
unsigned cv;
|
|
||||||
uint i;
|
|
||||||
|
|
||||||
if (llvmpipe->no_rast)
|
if (llvmpipe->no_rast)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if 0
|
lp_setup_clear( llvmpipe->setup, buffers, rgba, depth, stencil );
|
||||||
llvmpipe_update_derived(llvmpipe); /* not needed?? */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_COLOR) {
|
|
||||||
for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
|
|
||||||
struct pipe_surface *ps = llvmpipe->framebuffer.cbufs[i];
|
|
||||||
|
|
||||||
util_pack_color(rgba, ps->format, &cv);
|
|
||||||
lp_tile_cache_clear(llvmpipe->cbuf_cache[i], rgba, cv);
|
|
||||||
}
|
|
||||||
llvmpipe->dirty_render_cache = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
|
|
||||||
struct pipe_surface *ps = llvmpipe->framebuffer.zsbuf;
|
|
||||||
|
|
||||||
cv = util_pack_z_stencil(ps->format, depth, stencil);
|
|
||||||
|
|
||||||
/* non-cached surface */
|
|
||||||
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue