panfrost: Implement Z32F_S8 blits
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 9 Jul 2020 20:34:00 +0000 (16:34 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jul 2020 19:59:43 +0000 (19:59 +0000)
Requires the ability to texture the stencil-only portion, and then
u_blitter kicks in for the rest.

v2: Fix dEQP-GLES31.functional.stencil_texturing.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5858>

.gitlab-ci/deqp-panfrost-t860-fails.txt
src/gallium/drivers/panfrost/pan_context.c
src/panfrost/encoder/pan_format.c

index 93de93424e691af3e079d6dbe301c99edd5cc8a5..3aa1e1d6f7ba45eac7c808e6dac6fb6be12498a4 100644 (file)
@@ -1,6 +1,3 @@
-dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_basic
-dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_scale
-dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_stencil_only
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_x
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_y
index e63afd8d9cc39cfda826dc3b4a294cc25564c3ef..37c9fee621cdbca002f62daa33657cb4f17fa009 100644 (file)
@@ -937,8 +937,17 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
 {
         struct panfrost_device *device = pan_device(pctx->screen);
         struct panfrost_resource *prsrc = (struct panfrost_resource *)texture;
+        enum pipe_format format = so->base.format;
         assert(prsrc->bo);
 
+        /* Format to access the stencil portion of a Z32_S8 texture */
+        if (so->base.format == PIPE_FORMAT_X32_S8X24_UINT) {
+                assert(prsrc->separate_stencil);
+                texture = &prsrc->separate_stencil->base;
+                prsrc = (struct panfrost_resource *)texture;
+                format = texture->format;
+        }
+
         so->texture_bo = prsrc->bo->gpu;
         so->layout = prsrc->layout;
 
@@ -977,7 +986,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
 
         if (device->quirks & IS_BIFROST) {
                 const struct util_format_description *desc =
-                        util_format_description(so->base.format);
+                        util_format_description(format);
                 unsigned char composed_swizzle[4];
                 util_format_compose_swizzles(desc->swizzle, user_swizzle, composed_swizzle);
 
@@ -996,7 +1005,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 so->bifrost_descriptor,
                                 texture->width0, texture->height0,
                                 depth, array_size,
-                                so->base.format,
+                                format,
                                 type, prsrc->layout,
                                 so->base.u.tex.first_level,
                                 so->base.u.tex.last_level,
@@ -1024,7 +1033,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 so->bo->cpu,
                                 texture->width0, texture->height0,
                                 depth, array_size,
-                                so->base.format,
+                                format,
                                 type, prsrc->layout,
                                 so->base.u.tex.first_level,
                                 so->base.u.tex.last_level,
index 23af83887e3fcb54a4686f77279a23a9f75721aa..76006164a36198a4e59afc4e17077e281af02779 100644 (file)
@@ -159,6 +159,7 @@ struct panfrost_format panfrost_pipe_format_table[PIPE_FORMAT_COUNT] = {
         [PIPE_FORMAT_Z24X8_UNORM]              = { MALI_Z24X8_UNORM, _TZ },
         [PIPE_FORMAT_Z32_FLOAT]                        = { MALI_R32F, _TZ },
         [PIPE_FORMAT_Z32_FLOAT_S8X24_UINT]     = { MALI_R32F, _TZ },
+        [PIPE_FORMAT_X32_S8X24_UINT]           = { MALI_R8UI, _T },
         [PIPE_FORMAT_X24S8_UINT]               = { MALI_RGBA8UI, _TZ },
         [PIPE_FORMAT_S8_UINT]                  = { MALI_R8UI, _T },