i965/blorp: unit test compiling msaa-8 cms to cms
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 10 Dec 2013 20:24:44 +0000 (22:24 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 27 Dec 2013 09:59:11 +0000 (11:59 +0200)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/test_blorp_blit_eu_gen.cpp

index 29f815ccd992ad1896e00b8f6af36eff78da6548..5d49acef900c81e831b8ae689dc4439b211dfc0e 100644 (file)
@@ -375,6 +375,67 @@ test_gen7_msaa_8_ums_to_cms(struct brw_context *brw)
    return check(brw, &key, expected, sizeof(expected) - 1);
 }
 
+static bool
+test_gen7_msaa_8_cms_to_cms(struct brw_context *brw)
+{
+   static const char expected[] =
+      "0x00000000: add(16)         g44<1>UW        g1.4<2,4,0>UW   0x10101010V     { align1 WE_normal 1H };\n"
+      "0x00000010: add(16)         g46<1>UW        g1.5<2,4,0>UW   0x11001100V     { align1 WE_normal 1H };\n"
+      "0x00000020: mov(16)         g48<1>UD        g44<8,8,1>UW                    { align1 WE_normal 1H };\n"
+      "0x00000030: mov(16)         g50<1>UD        g46<8,8,1>UW                    { align1 WE_normal 1H };\n"
+      "0x00000040: and(1)          g54<1>UD        g0<0,1,0>UD     0x000000c0UD    { align1 WE_normal };\n"
+      "0x00000050: shr(1)          g54<1>UD        g54<0,1,0>UD    0x00000005UD    { align1 WE_normal };\n"
+      "0x00000060: mov(16)         g56<1>UW        0x00003210V                     { align1 WE_normal 1H };\n"
+      "0x00000070: add(16)         g52<1>UD        g54<0,1,0>UW    g56<1,4,0>UW    { align1 WE_normal 1H };\n"
+      "0x00000080: add(8)          g53<1>UD        g54<0,1,0>UW    g56.2<1,4,0>UW  { align1 WE_normal 1Q };\n"
+      "0x00000090: mov(16)         g44<1>F         g48<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x000000a0: mov(16)         g46<1>F         g50<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x000000b0: mul(16)         g48<1>F         g44<8,8,1>F     g2.6<0,1,0>F    { align1 WE_normal 1H };\n"
+      "0x000000c0: mul(16)         g50<1>F         g46<8,8,1>F     g3<0,1,0>F      { align1 WE_normal 1H };\n"
+      "0x000000d0: add(16)         g48<1>F         g48<8,8,1>F     g2.7<0,1,0>F    { align1 WE_normal 1H };\n"
+      "0x000000e0: add(16)         g50<1>F         g50<8,8,1>F     g3.1<0,1,0>F    { align1 WE_normal 1H };\n"
+      "0x000000f0: mov(16)         g44<1>UD        g48<8,8,1>F                     { align1 WE_normal 1H };\n"
+      "0x00000100: mov(16)         g46<1>UD        g50<8,8,1>F                     { align1 WE_normal 1H };\n"
+      "0x00000110: mov(16)         g114<1>UD       g44<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000120: mov(16)         g116<1>UD       g46<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000130: send(16)        g36<1>UW        g114<8,8,1>F\n"
+      "                sampler (0, 0, 29, 2) mlen 4 rlen 8             { align1 WE_normal 1H };\n"
+      "0x00000140: mov(16)         g114<1>UD       g52<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000150: mov(16)         g116<1>UD       g36<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000160: mov(16)         g118<1>UD       g44<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000170: mov(16)         g120<1>UD       g46<8,8,1>UD                    { align1 WE_normal 1H };\n"
+      "0x00000180: send(16)        g4<1>UW         g114<8,8,1>F\n"
+      "                sampler (0, 0, 30, 2) mlen 8 rlen 8             { align1 WE_normal 1H };\n"
+      "0x00000190: mov(16)         g114<1>F        g4<8,8,1>F                      { align1 WE_normal 1H };\n"
+      "0x000001a0: mov(16)         g116<1>F        g6<8,8,1>F                      { align1 WE_normal 1H };\n"
+      "0x000001b0: mov(16)         g118<1>F        g8<8,8,1>F                      { align1 WE_normal 1H };\n"
+      "0x000001c0: mov(16)         g120<1>F        g10<8,8,1>F                     { align1 WE_normal 1H };\n"
+      "0x000001d0: sendc(16)       null            g114<8,8,1>F\n"
+      "                render ( RT write, 1, 0, 12) mlen 8 rlen 0      { align1 WE_normal 1H EOT };\n";
+   struct brw_blorp_blit_prog_key key;
+
+   key.tex_samples = 8;
+   key.tex_layout = INTEL_MSAA_LAYOUT_CMS;
+   key.src_samples = 8;
+   key.src_layout = INTEL_MSAA_LAYOUT_CMS;
+   key.rt_samples = 8;
+   key.rt_layout = INTEL_MSAA_LAYOUT_CMS;
+   key.dst_samples = 8;
+   key.dst_layout = INTEL_MSAA_LAYOUT_CMS;
+   key.texture_data_type = BRW_REGISTER_TYPE_F;
+   key.src_tiled_w = false;
+   key.dst_tiled_w = false;
+   key.blend = false;
+   key.use_kill = false;
+   key.persample_msaa_dispatch = true;
+   key.blit_scaled = false;
+   key.x_scale = 2.000000;
+   key.y_scale = 4.000000;
+   key.bilinear_filter = false;
+
+   return check(brw, &key, expected, sizeof(expected) - 1);
+}
+
 int
 main(int argc, char **argv)
 {
@@ -386,6 +447,7 @@ main(int argc, char **argv)
 
    pass = test_gen7_blend_scaled_msaa_8(&brw) && pass;
    pass = test_gen7_msaa_8_ums_to_cms(&brw) && pass;
+   pass = test_gen7_msaa_8_cms_to_cms(&brw) && pass;
 
    /* Test suite expects zero for success */
    return !pass;