diff options
author | Brian <[email protected]> | 2007-10-23 18:49:19 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-24 12:32:42 -0600 |
commit | 76a4fd098f44ae4f226d4747b9fdaf9db5d40270 (patch) | |
tree | b6892ce9414a71e1ef835619ab51278e3d8ac684 /src/mesa/pipe/softpipe/sp_clear.c | |
parent | b78e90807abc31f58492992cdfe5e01bfd53e68b (diff) |
a bit more work for optimizing clears in tile cache (not enabled yet)
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_clear.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_clear.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c index 96bca4b171b..08b87417aa4 100644 --- a/src/mesa/pipe/softpipe/sp_clear.c +++ b/src/mesa/pipe/softpipe/sp_clear.c @@ -47,7 +47,7 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps, unsigned clearValue) { struct softpipe_context *softpipe = softpipe_context(pipe); - /*struct softpipe_surface *sps = softpipe_surface(ps);*/ + struct softpipe_surface *sps = softpipe_surface(ps); unsigned x, y, w, h; softpipe_update_derived(softpipe); /* not needed?? */ @@ -66,9 +66,23 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps, assert(w <= ps->region->pitch); assert(h <= ps->region->height); - /* XXX skip this fill if we're using tile cache */ + if (sps == sp_tile_cache_get_surface(softpipe->zbuf_cache)) { + float clear[4]; + clear[0] = 1.0; /* XXX hack */ + sp_tile_cache_clear(softpipe->zbuf_cache, clear); + } + else if (sps == sp_tile_cache_get_surface(softpipe->cbuf_cache[0])) { + float clear[4]; + clear[0] = 0.2; /* XXX hack */ + clear[1] = 0.2; /* XXX hack */ + clear[2] = 0.2; /* XXX hack */ + clear[3] = 0.2; /* XXX hack */ + sp_tile_cache_clear(softpipe->cbuf_cache[0], clear); + } + pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearValue); + #if 0 sp_clear_tile_cache(sps, clearValue); #endif |