summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-07-20 15:00:28 +0200
committerMichal Krol <[email protected]>2010-07-20 15:01:25 +0200
commit3b2ca688a7016fe504768ecb72f2e42c7b2905ac (patch)
tree822892ac88dc36116f0d2859ea83b9b1f19f485e /src/gallium/drivers/softpipe
parentc1cbdbfde0a1f016f9d3f23a39cb7bc0b9825e12 (diff)
softpipe: Support non-depth-stencil formats in sp_tile_cache_flush_clear().
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index f4db6f6ef00..05a3294e97f 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -284,7 +284,11 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc)
assert(pt->resource);
/* clear the scratch tile to the clear value */
- clear_tile(&tc->tile, pt->resource->format, tc->clear_val);
+ if (tc->depth_stencil) {
+ clear_tile(&tc->tile, pt->resource->format, tc->clear_val);
+ } else {
+ clear_tile_rgba(&tc->tile, pt->resource->format, tc->clear_color);
+ }
/* push the tile to all positions marked as clear */
for (y = 0; y < h; y += TILE_SIZE) {
@@ -292,10 +296,11 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc)
union tile_address addr = tile_address(x, y);
if (is_clear_flag_set(tc->clear_flags, addr)) {
+ /* write the scratch tile to the surface */
pipe_put_tile_raw(tc->pipe,
pt,
x, y, TILE_SIZE, TILE_SIZE,
- tc->tile.data.color32, 0/*STRIDE*/);
+ tc->tile.data.any, 0/*STRIDE*/);
numCleared++;
}