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 | |
parent | e3b38e5ec1ba93e3f1a1b3d5039c70ff7aa3ebe6 (diff) |
llvmpipe: Drop depth/stencil support from tile cache.
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_cache.c | 97 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_cache.h | 4 |
2 files changed, 18 insertions, 83 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); } } diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.h b/src/gallium/drivers/llvmpipe/lp_tile_cache.h index d4774bad3b6..147a60bca65 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.h +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.h @@ -64,9 +64,6 @@ struct llvmpipe_cached_tile uint8_t ALIGN16_ATTRIB color[TILE_SIZE*TILE_SIZE*NUM_CHANNELS]; uint color32[TILE_SIZE][TILE_SIZE]; - uint depth32[TILE_SIZE][TILE_SIZE]; - ushort depth16[TILE_SIZE][TILE_SIZE]; - ubyte stencil8[TILE_SIZE][TILE_SIZE]; ubyte any[1]; } data; }; @@ -93,7 +90,6 @@ struct llvmpipe_tile_cache uint clear_flags[(MAX_WIDTH / TILE_SIZE) * (MAX_HEIGHT / TILE_SIZE) / 32]; float clear_color[4]; /**< for color bufs */ uint clear_val; /**< for z+stencil, or packed color clear value */ - boolean depth_stencil; /**< Is the surface a depth/stencil format? */ struct pipe_transfer *tex_trans; void *tex_trans_map; |