Module: Mesa Branch: main Commit: eed57ada6e082707c73ebf0ac3968bd52bf74113 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eed57ada6e082707c73ebf0ac3968bd52bf74113
Author: Boris Brezillon <[email protected]> Date: Mon Aug 23 17:46:18 2021 +0200 panfrost: Patch Z32_S8X24 format when creating a sampler view The gallium driver always stores Z32_S8X24 textures on 2 different planes. Let's fix the create_sampler_view() logic so we can support single-planar Z32_S8X24 in the vulkan driver. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12508> --- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 47fd051e5bd..b0074499f89 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1244,12 +1244,14 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, enum pipe_format format = so->base.format; assert(prsrc->image.data.bo); - /* Format to access the stencil portion of a Z32_S8 texture */ + /* Format to access the stencil/depth portion of a Z32_S8 texture */ if (format == PIPE_FORMAT_X32_S8X24_UINT) { assert(prsrc->separate_stencil); texture = &prsrc->separate_stencil->base; prsrc = (struct panfrost_resource *)texture; format = texture->format; + } else if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) { + format = PIPE_FORMAT_Z32_FLOAT; } const struct util_format_description *desc = util_format_description(format);
