Mesa (main): pan/bi: Add VAR_TEX fusing unit test

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 30 22:27:58 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri May 27 14:13:40 2022 -0400

pan/bi: Add VAR_TEX fusing unit test

As fusing VAR_TEX is an optimization, it's helpful to have unit tests since
functional tests won't check that the optimization triggers when expected.
Originally written when I was touching the VAR_TEX code. Those changes have
since been dropped by the unit test remains useful.

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

---

 src/panfrost/bifrost/test/test-optimizer.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/panfrost/bifrost/test/test-optimizer.cpp b/src/panfrost/bifrost/test/test-optimizer.cpp
index 03d3f8e34fb..e4e16a32ea0 100644
--- a/src/panfrost/bifrost/test/test-optimizer.cpp
+++ b/src/panfrost/bifrost/test/test-optimizer.cpp
@@ -421,3 +421,20 @@ TEST_F(Optimizer, DoNotFuseMixedSizeResultType)
                       bi_fcmp_f32(b, bi_abs(x), bi_neg(y), BI_CMPF_LE, BI_RESULT_TYPE_M1),
                       BI_MUX_INT_ZERO));
 }
+
+TEST_F(Optimizer, VarTexCoord32)
+{
+   CASE({
+         bi_index ld = bi_ld_var_imm(b, bi_null(), BI_REGISTER_FORMAT_F32, BI_SAMPLE_CENTER, BI_UPDATE_STORE, BI_VECSIZE_V2, 0);
+
+         bi_index x = bi_temp(b->shader);
+         bi_index y = bi_temp(b->shader);
+         bi_instr *split = bi_split_i32_to(b, x, ld);
+         split->nr_dests = 2;
+         split->dest[1] = y;
+
+         bi_texs_2d_f32_to(b, reg, x, y, false, 0, 0);
+   }, {
+         bi_var_tex_f32_to(b, reg, false, BI_SAMPLE_CENTER, BI_UPDATE_STORE, 0, 0);
+   });
+}



More information about the mesa-commit mailing list