diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-01-03 14:15:28 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-01-06 07:49:42 -0500 |
commit | ef0084987707e4c37435f19284b58919f6164bea (patch) | |
tree | 707dde77d7d587492070d021f7773ac312453515 /src/gallium/drivers | |
parent | ef8c2ebee185116e0bd3c57658b7e018bb0a23ea (diff) |
panfrost: Support rendering to non-zero Z/S layers
Fixes abort in STK's shadow implementation.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Tomeu Vizoso <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index 0f2931a58b3..5140f3ba9bb 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -235,16 +235,16 @@ panfrost_mfbd_set_zsbuf( struct panfrost_resource *rsrc = pan_resource(surf->texture); unsigned level = surf->u.tex.level; - assert(surf->u.tex.first_layer == 0); + unsigned first_layer = surf->u.tex.first_layer; + assert(surf->u.tex.last_layer == first_layer); - unsigned offset = rsrc->slices[level].offset; + mali_ptr base = panfrost_get_texture_address(rsrc, level, first_layer); if (rsrc->layout == PAN_AFBC) { /* The only Z/S format we can compress is Z24S8 or variants * thereof (handled by the state tracker) */ assert(panfrost_is_z24s8_variant(surf->format)); - mali_ptr base = rsrc->bo->gpu + offset; unsigned header_size = rsrc->slices[level].header_size; fb->mfbd_flags |= MALI_MFBD_EXTRA; @@ -270,7 +270,7 @@ panfrost_mfbd_set_zsbuf( fb->mfbd_flags |= MALI_MFBD_EXTRA; fbx->flags |= MALI_EXTRA_PRESENT | MALI_EXTRA_ZS; - fbx->ds_linear.depth = rsrc->bo->gpu + offset; + fbx->ds_linear.depth = base; fbx->ds_linear.depth_stride = stride; if (panfrost_is_z24s8_variant(surf->format)) { @@ -289,7 +289,7 @@ panfrost_mfbd_set_zsbuf( 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 = panfrost_get_texture_address(stencil, level, first_layer); fbx->ds_linear.stencil_stride = stencil_slice.stride; } |