panfrost: Fix several depth/stencil format mappings
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 27 Nov 2020 20:03:36 +0000 (21:03 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 11 Dec 2020 09:47:38 +0000 (09:47 +0000)
Stencil should always be loaded in component Y, even when the buffer
only contains stencil values. Patch the blit shaders accordingly, and
fix some format definitions.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7922>

.gitlab-ci/deqp-panfrost-t860-fails.txt
.gitlab-ci/traces-panfrost.yml
src/panfrost/lib/pan_blit.c
src/panfrost/lib/pan_format.c

index 462f206..cd500e3 100644 (file)
@@ -12,24 +12,6 @@ dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_x,Fa
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_y,Fail
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_x,Fail
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_y,Fail
-dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_color,Fail
-dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_depth,Fail
-dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_stencil,Fail
-dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_color,Fail
-dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_depth,Fail
-dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_stencil,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.depth24_stencil8,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.depth32f_stencil8,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component16,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component24,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component32f,Fail
-dEQP-GLES3.functional.fbo.msaa.2_samples.stencil_index8,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.depth24_stencil8,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.depth32f_stencil8,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component16,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component24,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component32f,Fail
-dEQP-GLES3.functional.fbo.msaa.4_samples.stencil_index8,Fail
 dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_loop_read_fragment,Crash
 dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_loop_read_vertex,Crash
 dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_read_fragment,Crash
index 2e2e84f..156602d 100644 (file)
@@ -51,7 +51,7 @@ traces:
   - path: humus/Portals.trace
     expectations:
       - device: gl-panfrost-t860
-        checksum: 5415bbf2a69b605bb1052a0e0b0f7040
+        checksum: f83da726bff354684a576effa74ef681
       - device: gl-panfrost-t760
         checksum: a41f53e9318cbd32c27b48d304df1ea6
   - path: 0ad/0ad.trace
index d449f1b..df4b4bc 100644 (file)
@@ -96,10 +96,12 @@ panfrost_build_blit_shader(struct panfrost_device *dev,
         nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32, NULL);
         nir_builder_instr_insert(b, &tex->instr);
 
-        if (is_colour)
+        if (is_colour) {
                 nir_store_var(b, c_out, &tex->dest.ssa, 0xFF);
-        else
-                nir_store_var(b, c_out, nir_channel(b, &tex->dest.ssa, 0), 0xFF);
+        } else {
+                unsigned c = loc == FRAG_RESULT_STENCIL ? 1 : 0;
+                nir_store_var(b, c_out, nir_channel(b, &tex->dest.ssa, c), 0xFF);
+        }
 
         struct panfrost_compile_inputs inputs = {
                 .gpu_id = dev->gpu_id,
index 3edbec3..7a4e142 100644 (file)
@@ -96,6 +96,8 @@ panfrost_blend_format(enum pipe_format format)
 #define FLAGS__T_Z (_T | _Z)
 
 #define V6_000R PAN_V6_SWIZZLE(0, 0, 0, R)
+#define V6_0R00 PAN_V6_SWIZZLE(0, R, 0, 0)
+#define V6_0A00 PAN_V6_SWIZZLE(0, A, 0, 0)
 #define V6_A001 PAN_V6_SWIZZLE(A, 0, 0, 1)
 #define V6_ABG1 PAN_V6_SWIZZLE(A, B, G, 1)
 #define V6_ABGR PAN_V6_SWIZZLE(A, B, G, R)
@@ -241,9 +243,9 @@ const struct panfrost_format panfrost_pipe_format_v6[PIPE_FORMAT_COUNT] = {
         PAN_V6(Z24X8_UNORM,             Z24X8_UNORM,     R000, L, _T_Z),
         PAN_V6(Z32_FLOAT,               R32F,            R000, L, _T_Z),
         PAN_V6(Z32_FLOAT_S8X24_UINT,    R32F,            R000, L, _T_Z),
-        PAN_V6(X32_S8X24_UINT,          R32UI,           R001, L, _T__),
-        PAN_V6(X24S8_UINT,              RGBA8UI,         A001, L, _T_Z),
-        PAN_V6(S8_UINT,                 R8UI,            R001, L, _T__),
+        PAN_V6(X32_S8X24_UINT,          R32UI,           0R00, L, _T__),
+        PAN_V6(X24S8_UINT,              RGBA8UI,         0A00, L, _T_Z),
+        PAN_V6(S8_UINT,                 R8UI,            0R00, L, _T__),
         PAN_V6(R32_FIXED,               R32_FIXED,       R001, L, V___),
         PAN_V6(R32G32_FIXED,            RG32_FIXED,      RG01, L, V___),
         PAN_V6(R32G32B32_FIXED,         RGB32_FIXED,     RGB1, L, V___),
@@ -491,9 +493,9 @@ const struct panfrost_format panfrost_pipe_format_v7[PIPE_FORMAT_COUNT] = {
         PAN_V7(Z24X8_UNORM,             Z24X8_UNORM,     RGBA, L, _T_Z),
         PAN_V7(Z32_FLOAT,               R32F,            RGBA, L, _T_Z),
         PAN_V7(Z32_FLOAT_S8X24_UINT,    R32F,            RGBA, L, _T_Z),
-        PAN_V7(X32_S8X24_UINT,          S8X24,           GRBA, L, _T__),
-        PAN_V7(X24S8_UINT,              TILEBUFFER_NATIVE /* XXX: Deduplicate enum */, GRBA, L, _T_Z),
-        PAN_V7(S8_UINT,                 S8,              GRBA, L, _T__),
+        PAN_V7(X32_S8X24_UINT,          S8X24,           RGBA, L, _T__),
+        PAN_V7(X24S8_UINT,              TILEBUFFER_NATIVE /* XXX: Deduplicate enum */, RGBA, L, _T_Z),
+        PAN_V7(S8_UINT,                 S8,              RGBA, L, _T__),
         PAN_V7(R32_FIXED,               R32_FIXED,       RGB1, L, V___),
         PAN_V7(R32G32_FIXED,            RG32_FIXED,      RGB1, L, V___),
         PAN_V7(R32G32B32_FIXED,         RGB32_FIXED,     RGB1, L, V___),