diff options
author | José Fonseca <[email protected]> | 2009-08-21 07:58:56 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-08-29 09:21:38 +0100 |
commit | 1cb9ce0d2721be7098f1dad39348f8cb65f9a6fc (patch) | |
tree | 5bdabd5f12f69d4911dd370c2b4d612c363845af /src/gallium/drivers/llvmpipe/lp_tile_cache.c | |
parent | e3b38e5ec1ba93e3f1a1b3d5039c70ff7aa3ebe6 (diff) |
llvmpipe: Drop depth/stencil support from tile cache.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_cache.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_cache.c | 97 |
1 files changed, 18 insertions, 79 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index e2fb157c024..c280cfe3ebc 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -156,14 +156,6 @@ lp_tile_cache_set_surface(struct llvmpipe_tile_cache *tc, ps->level, ps->zslice, PIPE_TRANSFER_READ_WRITE, 0, 0, ps->width, ps->height); - - tc->depth_stencil = (ps->format == PIPE_FORMAT_S8Z24_UNORM || - ps->format == PIPE_FORMAT_X8Z24_UNORM || - ps->format == PIPE_FORMAT_Z24S8_UNORM || - ps->format == PIPE_FORMAT_Z24X8_UNORM || - ps->format == PIPE_FORMAT_Z16_UNORM || - ps->format == PIPE_FORMAT_Z32_UNORM || - ps->format == PIPE_FORMAT_S8_UNORM); } } @@ -241,36 +233,15 @@ clear_tile(struct llvmpipe_cached_tile *tile, { uint i, j; - switch (pf_get_size(format)) { - case 1: - memset(tile->data.any, 0, TILE_SIZE * TILE_SIZE); - break; - case 2: - if (clear_value == 0) { - memset(tile->data.any, 0, 2 * TILE_SIZE * TILE_SIZE); - } - else { - for (i = 0; i < TILE_SIZE; i++) { - for (j = 0; j < TILE_SIZE; j++) { - tile->data.depth16[i][j] = (ushort) clear_value; - } - } - } - break; - case 4: - if (clear_value == 0) { - memset(tile->data.any, 0, 4 * TILE_SIZE * TILE_SIZE); - } - else { - for (i = 0; i < TILE_SIZE; i++) { - for (j = 0; j < TILE_SIZE; j++) { - tile->data.color32[i][j] = clear_value; - } + if (clear_value == 0) { + memset(tile->data.any, 0, 4 * TILE_SIZE * TILE_SIZE); + } + else { + for (i = 0; i < TILE_SIZE; i++) { + for (j = 0; j < TILE_SIZE; j++) { + tile->data.color32[i][j] = clear_value; } } - break; - default: - assert(0); } } @@ -328,19 +299,10 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc) for (pos = 0; pos < NUM_ENTRIES; pos++) { struct llvmpipe_cached_tile *tile = tc->entries + pos; if (!tile->addr.bits.invalid) { - if (tc->depth_stencil) { - pipe_put_tile_raw(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - tile->data.depth32, 0/*STRIDE*/); - } - else { - lp_put_tile_rgba_soa(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - tile->data.color); - } + lp_put_tile_rgba_soa(pt, + tile->addr.bits.x * TILE_SIZE, + tile->addr.bits.y * TILE_SIZE, + tile->data.color); tile->addr.bits.invalid = 1; /* mark as empty */ inuse++; } @@ -383,48 +345,25 @@ lp_find_cached_tile(struct llvmpipe_tile_cache *tc, if (tile->addr.bits.invalid == 0) { /* put dirty tile back in framebuffer */ - if (tc->depth_stencil) { - pipe_put_tile_raw(pt, + lp_put_tile_rgba_soa(pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - tile->data.depth32, 0/*STRIDE*/); - } - else { - lp_put_tile_rgba_soa(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - tile->data.color); - } + tile->data.color); } tile->addr = addr; if (is_clear_flag_set(tc->clear_flags, addr)) { /* don't get tile from framebuffer, just clear it */ - if (tc->depth_stencil) { - clear_tile(tile, pt->format, tc->clear_val); - } - else { - clear_tile_rgba(tile, pt->format, tc->clear_color); - } + clear_tile_rgba(tile, pt->format, tc->clear_color); clear_clear_flag(tc->clear_flags, addr); } else { /* get new tile data from transfer */ - if (tc->depth_stencil) { - pipe_get_tile_raw(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - tile->data.depth32, 0/*STRIDE*/); - } - else { - lp_get_tile_rgba_soa(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - tile->data.color); - } + lp_get_tile_rgba_soa(pt, + tile->addr.bits.x * TILE_SIZE, + tile->addr.bits.y * TILE_SIZE, + tile->data.color); } } |