Mesa (main): panfrost: Test src*dst + dst*src blending

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 11 18:32:48 UTC 2021


Module: Mesa
Branch: main
Commit: cdfb5d37883beae48b5d38179700091a5707db0d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cdfb5d37883beae48b5d38179700091a5707db0d

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri Jul 30 19:30:05 2021 -0400

panfrost: Test src*dst + dst*src blending

Validates the prior commit.

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

---

 src/panfrost/lib/tests/test-blend.c | 78 +++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/src/panfrost/lib/tests/test-blend.c b/src/panfrost/lib/tests/test-blend.c
index f61943dfe72..693cedd8853 100644
--- a/src/panfrost/lib/tests/test-blend.c
+++ b/src/panfrost/lib/tests/test-blend.c
@@ -182,7 +182,85 @@ static const struct test blend_tests[] = {
       .fixed_function = true,
       .hardware = 0xA0231231 /* equivalently 0xA0321321 */
    },
+   {
+      "src*dst + dst*src",
+      {
+         .blend_enable = true,
+         .color_mask = 0xF,
 
+         RGBA(func, BLEND_FUNC_ADD),
+         RGBA(src_factor, BLEND_FACTOR_DST_COLOR),
+         RGBA(dst_factor, BLEND_FACTOR_SRC_COLOR),
+      },
+      .constant_mask = 0x0,
+      .reads_dest = true,
+      .opaque = false,
+      .fixed_function = true,
+      .hardware = 0xF0431431 /* 0 + dest * (2*src) */
+   },
+   {
+      "Mixed src*dst + dst*src masked I",
+      {
+         .blend_enable = true,
+         .color_mask = 0xC,
+
+         .rgb_func = BLEND_FUNC_ADD,
+         .rgb_src_factor = BLEND_FACTOR_ZERO,
+         .rgb_invert_src_factor = true,
+         .rgb_dst_factor= BLEND_FACTOR_ZERO,
+
+         .alpha_func = BLEND_FUNC_ADD,
+         .alpha_src_factor = BLEND_FACTOR_DST_COLOR,
+         .alpha_dst_factor= BLEND_FACTOR_SRC_COLOR,
+      },
+      .constant_mask = 0x0,
+      .reads_dest = true,
+      .opaque = false,
+      .fixed_function = true,
+      .hardware = 0xC0431132 /* 0 + dest * (2*src); equivalent 0xC0431122 */
+   },
+   {
+      "Mixed src*dst + dst*src masked II",
+      {
+         .blend_enable = true,
+         .color_mask = 0xC,
+
+         .rgb_func = BLEND_FUNC_ADD,
+         .rgb_src_factor = BLEND_FACTOR_ZERO,
+         .rgb_invert_src_factor = true,
+         .rgb_dst_factor= BLEND_FACTOR_ZERO,
+
+         .alpha_func = BLEND_FUNC_ADD,
+         .alpha_src_factor = BLEND_FACTOR_DST_ALPHA,
+         .alpha_dst_factor= BLEND_FACTOR_SRC_COLOR,
+      },
+      .constant_mask = 0x0,
+      .reads_dest = true,
+      .opaque = false,
+      .fixed_function = true,
+      .hardware = 0xC0431132 /* 0 + dest * (2*src); equivalent 0xC0431122 */
+   },
+   {
+      "Mixed src*dst + dst*src masked III",
+      {
+         .blend_enable = true,
+         .color_mask = 0xC,
+
+         .rgb_func = BLEND_FUNC_ADD,
+         .rgb_src_factor = BLEND_FACTOR_ZERO,
+         .rgb_invert_src_factor = true,
+         .rgb_dst_factor= BLEND_FACTOR_ZERO,
+
+         .alpha_func = BLEND_FUNC_ADD,
+         .alpha_src_factor = BLEND_FACTOR_DST_ALPHA,
+         .alpha_dst_factor= BLEND_FACTOR_SRC_ALPHA,
+      },
+      .constant_mask = 0x0,
+      .reads_dest = true,
+      .opaque = false,
+      .fixed_function = true,
+      .hardware = 0xC0431132 /* 0 + dest * (2*src); equivalent 0xC0431122 */
+   }
 };
 
 #define ASSERT_EQ(x, y) do { \



More information about the mesa-commit mailing list