llvmpipe: generate multisample triangle rasterizer functions (v2)
authorDave Airlie <airlied@redhat.com>
Fri, 20 Mar 2020 21:29:04 +0000 (07:29 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
This uses the templating to generate multisample version of the
tri plane raster functions

This doesn't generate any optimised version for lower plane numbers,
maybe this is worth doing in the future.

v2: drop generating 32-bit msaa (Roland)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>

src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_rast_priv.h
src/gallium/drivers/llvmpipe/lp_rast_tri.c

index 551b517fbb24ee64295c28ee4239d0d47d370b2e..777c4450c7f0cea78e0066b46e60728cf5a3d056 100644 (file)
@@ -627,7 +627,18 @@ static lp_rast_cmd_func dispatch[LP_RAST_OP_MAX] =
    lp_rast_triangle_32_8,
    lp_rast_triangle_32_3_4,
    lp_rast_triangle_32_3_16,
-   lp_rast_triangle_32_4_16
+   lp_rast_triangle_32_4_16,
+   lp_rast_triangle_ms_1,
+   lp_rast_triangle_ms_2,
+   lp_rast_triangle_ms_3,
+   lp_rast_triangle_ms_4,
+   lp_rast_triangle_ms_5,
+   lp_rast_triangle_ms_6,
+   lp_rast_triangle_ms_7,
+   lp_rast_triangle_ms_8,
+   lp_rast_triangle_ms_3_4,
+   lp_rast_triangle_ms_3_16,
+   lp_rast_triangle_ms_4_16,
 };
 
 
index 43a3064be77479a84f4fe075061eb36c402657fc..425893704474c7010112df611c6c81bdcbb74e6e 100644 (file)
@@ -304,7 +304,18 @@ lp_rast_arg_null( void )
 #define LP_RAST_OP_TRIANGLE_32_3_16  0x1b
 #define LP_RAST_OP_TRIANGLE_32_4_16  0x1c
 
-#define LP_RAST_OP_MAX               0x1d
+#define LP_RAST_OP_MS_TRIANGLE_1     0x1d
+#define LP_RAST_OP_MS_TRIANGLE_2     0x1e
+#define LP_RAST_OP_MS_TRIANGLE_3     0x1f
+#define LP_RAST_OP_MS_TRIANGLE_4     0x20
+#define LP_RAST_OP_MS_TRIANGLE_5     0x21
+#define LP_RAST_OP_MS_TRIANGLE_6     0x22
+#define LP_RAST_OP_MS_TRIANGLE_7     0x23
+#define LP_RAST_OP_MS_TRIANGLE_8     0x24
+#define LP_RAST_OP_MS_TRIANGLE_3_4   0x25
+#define LP_RAST_OP_MS_TRIANGLE_3_16  0x26
+#define LP_RAST_OP_MS_TRIANGLE_4_16  0x27
+#define LP_RAST_OP_MAX               0x28
 #define LP_RAST_OP_MASK              0xff
 
 void
index de8527ae0c63ac400319d19afc99e3f44c367af1..aaf52025f1c2585c521425ef8af24a760d64e38e 100644 (file)
@@ -346,6 +346,58 @@ void lp_rast_triangle_32_3_16( struct lp_rasterizer_task *,
 void lp_rast_triangle_32_4_16( struct lp_rasterizer_task *, 
                             const union lp_rast_cmd_arg );
 
+void lp_rast_triangle_ms_1( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_2( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_3( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_4( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_5( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_6( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_7( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_8( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_3_4(struct lp_rasterizer_task *,
+                          const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_3_16( struct lp_rasterizer_task *,
+                            const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_4_16( struct lp_rasterizer_task *,
+                            const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_32_1( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_2( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_3( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_4( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_5( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_6( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_7( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+void lp_rast_triangle_ms_32_8( struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_32_3_4(struct lp_rasterizer_task *,
+                          const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_32_3_16( struct lp_rasterizer_task *,
+                            const union lp_rast_cmd_arg );
+
+void lp_rast_triangle_ms_32_4_16( struct lp_rasterizer_task *,
+                            const union lp_rast_cmd_arg );
+
 void
 lp_rast_set_state(struct lp_rasterizer_task *task,
                   const union lp_rast_cmd_arg arg);
index c479c91dff6759cf02076268044086e24c11f728..01fbd2d9d740f5f521b4198cc0e105f1c5fc5cb0 100644 (file)
@@ -133,6 +133,33 @@ lp_rast_triangle_4_16(struct lp_rasterizer_task *task,
    lp_rast_triangle_4(task, arg2);
 }
 
+void
+lp_rast_triangle_ms_3_16(struct lp_rasterizer_task *task,
+                      const union lp_rast_cmd_arg arg)
+{
+   union lp_rast_cmd_arg arg2;
+   arg2.triangle.tri = arg.triangle.tri;
+   arg2.triangle.plane_mask = (1<<3)-1;
+   lp_rast_triangle_ms_3(task, arg2);
+}
+
+void
+lp_rast_triangle_ms_3_4(struct lp_rasterizer_task *task,
+                      const union lp_rast_cmd_arg arg)
+{
+   lp_rast_triangle_ms_3_16(task, arg);
+}
+
+void
+lp_rast_triangle_ms_4_16(struct lp_rasterizer_task *task,
+                      const union lp_rast_cmd_arg arg)
+{
+   union lp_rast_cmd_arg arg2;
+   arg2.triangle.tri = arg.triangle.tri;
+   arg2.triangle.plane_mask = (1<<4)-1;
+   lp_rast_triangle_ms_4(task, arg2);
+}
+
 #if defined(PIPE_ARCH_SSE)
 
 #include <emmintrin.h>
@@ -683,7 +710,6 @@ lp_rast_triangle_32_3_4(struct lp_rasterizer_task *task,
 
 #endif
 
-
 #if defined PIPE_ARCH_SSE
 #define BUILD_MASKS(c, cdiff, dcdx, dcdy, omask, pmask) build_masks_sse((int)c, (int)cdiff, dcdx, dcdy, omask, pmask)
 #define BUILD_MASK_LINEAR(c, dcdx, dcdy) build_mask_linear_sse((int)c, dcdx, dcdy)
@@ -771,3 +797,42 @@ lp_rast_triangle_32_3_4(struct lp_rasterizer_task *task,
 #define NR_PLANES 8
 #include "lp_rast_tri_tmp.h"
 
+#define MULTISAMPLE 1
+#define RASTER_64 1
+
+#define TAG(x) x##_ms_1
+#define NR_PLANES 1
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_2
+#define NR_PLANES 2
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_3
+#define NR_PLANES 3
+/*#define TRI_4 lp_rast_triangle_3_4*/
+/*#define TRI_16 lp_rast_triangle_3_16*/
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_4
+#define NR_PLANES 4
+/*#define TRI_16 lp_rast_triangle_4_16*/
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_5
+#define NR_PLANES 5
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_6
+#define NR_PLANES 6
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_7
+#define NR_PLANES 7
+#include "lp_rast_tri_tmp.h"
+
+#define TAG(x) x##_ms_8
+#define NR_PLANES 8
+#include "lp_rast_tri_tmp.h"
+
+#undef RASTER_64