aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-17 15:49:42 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-18 10:42:43 -0700
commit676b9339dd1ec2c85b1d223103a295a06efcffe1 (patch)
tree4cb3e3cbd3ed1088c3e55a43e16809f6fc3360d3 /src/gallium/drivers/panfrost
parent479185a1cdc305be7947f1b364ee1da40d36b66f (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c14
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c2
2 files changed, 16 insertions, 0 deletions
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: