summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tile_cache.c
diff options
context:
space:
mode:
authorMorgan Armand <morgan.devel@gmail.com>2011-12-07 21:30:48 +0100
committerDave Airlie <airlied@redhat.com>2012-01-03 16:19:08 +0000
commite763b6e78825f11aa3e9e2368ba8fc47313a7848 (patch)
treef3bebf70b127e91378c52ebc3c070a3e8f09cb8e /src/gallium/drivers/softpipe/sp_tile_cache.c
parent2ae591bdf13f02f23471ea302b55eaccbb810dd7 (diff)
softpipe: remove the 32bits limitation on depth(-stencil) formats
This patch remove the 32bits limitation. As a side effect, it bring the support for the GL_ARB_depth_buffer_float extension. No regression have been found on piglit, and all tests for GL_ARB_depth_buffer_float pass successfully. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tile_cache.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index ad6b0156c7e..659ac58e5b0 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -268,7 +268,7 @@ clear_tile_rgba(struct softpipe_cached_tile *tile,
static void
clear_tile(struct softpipe_cached_tile *tile,
enum pipe_format format,
- uint clear_value)
+ uint64_t clear_value)
{
uint i, j;
@@ -295,7 +295,19 @@ clear_tile(struct softpipe_cached_tile *tile,
else {
for (i = 0; i < TILE_SIZE; i++) {
for (j = 0; j < TILE_SIZE; j++) {
- tile->data.color32[i][j] = clear_value;
+ tile->data.depth32[i][j] = clear_value;
+ }
+ }
+ }
+ break;
+ case 8:
+ if (clear_value == 0) {
+ memset(tile->data.any, 0, 8 * TILE_SIZE * TILE_SIZE);
+ }
+ else {
+ for (i = 0; i < TILE_SIZE; i++) {
+ for (j = 0; j < TILE_SIZE; j++) {
+ tile->data.depth64[i][j] = clear_value;
}
}
}
@@ -601,7 +613,7 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
void
sp_tile_cache_clear(struct softpipe_tile_cache *tc,
const union pipe_color_union *color,
- uint clearValue)
+ uint64_t clearValue)
{
uint pos;