diff options
author | Roland Scheidegger <[email protected]> | 2013-05-18 00:16:03 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-05-18 00:32:33 +0200 |
commit | 070a9afb5476b58a2824fac5c94bbe4f78a2d8b9 (patch) | |
tree | e77b6e523a25460af9b97fe45e6793e4ab7c0297 /src/gallium/drivers/llvmpipe/lp_rast.c | |
parent | f3ad716e8f36fa1360703b73eafed1824c29db6e (diff) |
llvmpipe: handle z32s8x24 depth/stencil format
We need to split up the depth and stencil values in this case, and there's
some new logic required to handle float depth and stencil simultaneously.
Also make sure we get the 64bit zs clear values and masks propagated
correctly.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index a557db4b4dc..8a4b00f785d 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -193,8 +193,10 @@ lp_rast_clear_zstencil(struct lp_rasterizer_task *task, const union lp_rast_cmd_arg arg) { const struct lp_scene *scene = task->scene; - uint32_t clear_value = arg.clear_zstencil.value; - uint32_t clear_mask = arg.clear_zstencil.mask; + uint64_t clear_value64 = arg.clear_zstencil.value; + uint64_t clear_mask64 = arg.clear_zstencil.mask; + uint32_t clear_value = (uint32_t) clear_value64; + uint32_t clear_mask = (uint32_t) clear_mask64; const unsigned height = TILE_SIZE; const unsigned width = TILE_SIZE; const unsigned block_size = scene->zsbuf.blocksize; @@ -260,6 +262,28 @@ lp_rast_clear_zstencil(struct lp_rasterizer_task *task, } } break; + case 8: + clear_value64 &= clear_mask64; + if (clear_mask64 == 0xffffffffffULL) { + for (i = 0; i < height; i++) { + uint64_t *row = (uint64_t *)dst; + for (j = 0; j < width; j++) + *row++ = clear_value64; + dst += dst_stride; + } + } + else { + for (i = 0; i < height; i++) { + uint64_t *row = (uint64_t *)dst; + for (j = 0; j < width; j++) { + uint64_t tmp = ~clear_mask64 & *row; + *row++ = clear_value64 | tmp; + } + dst += dst_stride; + } + } + break; + default: assert(0); break; |