From: Alyssa Rosenzweig Date: Wed, 17 Jul 2019 22:49:42 +0000 (-0700) Subject: panfrost: Implement Z32F(_S8) support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=676b9339dd1ec2c85b1d223103a295a06efcffe1;p=mesa.git panfrost: Implement Z32F(_S8) support Z32F uses a dediacted float path. Z32F_S8 uses separate stencil planes in the hardware, lowered via u_transfer_helper. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index a35acc311bc..e3595af4cf1 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -313,6 +313,20 @@ panfrost_mfbd_set_zsbuf( fbx->flags |= 0x1; } else if (surf->format == PIPE_FORMAT_Z32_UNORM) { /* default flags (0 in bottom place) */ + } else if (surf->format == PIPE_FORMAT_Z32_FLOAT) { + fbx->flags |= 0xA; + fb->mfbd_flags ^= 0x100; + fb->mfbd_flags |= 0x200; + } else if (surf->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) { + fbx->flags |= 0x1000A; + fb->mfbd_flags ^= 0x100; + fb->mfbd_flags |= 0x201; + + struct panfrost_resource *stencil = rsrc->separate_stencil; + struct panfrost_slice stencil_slice = stencil->slices[level]; + + fbx->ds_linear.stencil = stencil->bo->gpu + stencil_slice.offset; + fbx->ds_linear.stencil_stride = stencil_slice.stride; } } else { diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 6fe9e60f69a..39d00009091 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -428,6 +428,8 @@ panfrost_is_format_supported( struct pipe_screen *screen, case PIPE_FORMAT_Z24_UNORM_S8_UINT: case PIPE_FORMAT_Z24X8_UNORM: case PIPE_FORMAT_Z32_UNORM: + case PIPE_FORMAT_Z32_FLOAT: + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: return true; default: