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 462f206643d8093a6ecb904155dac06010512be7..cd500e31ceeafb28019e9edc79273ba36d81c7db 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 2e2e84f6676f2ba1a7c41fa9ad5aa34f434e7689..156602d0d8fced5402267aa47551b9ecc1049206 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 d449f1b0fa2a6b1148d3288036605d808f4514ca..df4b4bc348c99d8bd14b690d9a3036c9d242533f 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 3edbec31cf0e4a4a8ea33e0a53c065c67ac3e998..7a4e1423b7dd59b337ad96694a318310fbde59b8 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___),