diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-03-12 22:49:33 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-14 22:47:11 +0000 |
commit | 9bf6024c6bccae34fb992db6ede6485c045cafde (patch) | |
tree | 8195f28174e266faa54697da9bfc80c1bae0db5e /src/gallium/drivers/panfrost/pan_mfbd.c | |
parent | 23e01357235273994c5e7b8658d360c84fba30ff (diff) |
panfrost/mfbd: Implement linear depth buffers
This removes a clunky hack where the depth buffer was enabled during the
*clear*, instead of during depth buffer linking. That said, this does
not yet support writeback like AFBC depth buffers.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_mfbd.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index a141fd314c0..b9c7cb221e7 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -58,8 +58,6 @@ panfrost_mfbd_clear( struct bifrost_fb_extra *fbx, struct bifrost_render_target *rt) { - struct panfrost_context *ctx = job->ctx; - if (job->clear & PIPE_CLEAR_COLOR) { rt->clear_color_1 = job->clear_color; rt->clear_color_2 = job->clear_color; @@ -74,14 +72,6 @@ panfrost_mfbd_clear( if (job->clear & PIPE_CLEAR_STENCIL) { fb->clear_stencil = job->clear_stencil; } - - if (job->clear & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) { - /* Setup combined 24/8 depth/stencil */ - fb->unk3 |= MALI_MFBD_EXTRA; - fbx->flags = 0x405; - fbx->ds_linear.depth = ctx->depth_stencil_buffer.gpu; - fbx->ds_linear.depth_stride = ctx->pipe_framebuffer.width * 4; - } } static void @@ -155,6 +145,15 @@ panfrost_mfbd_set_zsbuf( fbx->ds_afbc.padding = 0x1000; fb->unk3 |= MALI_MFBD_DEPTH_WRITE; + } else if (rsrc->bo->layout == PAN_LINEAR) { + fb->unk3 |= MALI_MFBD_EXTRA; + fbx->flags |= MALI_EXTRA_PRESENT | MALI_EXTRA_ZS | 0x1; + + fbx->ds_linear.depth = rsrc->bo->gpu[0]; + fbx->ds_linear.depth_stride = + util_format_get_stride(surf->format, surf->texture->width0); + } else { + assert(0); } } |