[Mesa-dev] [PATCH 3/8] swr/rast: Split rasterizer.cpp to improve compile times

Rowley, Timothy O timothy.o.rowley at intel.com
Mon Jun 26 16:21:03 UTC 2017


On Jun 26, 2017, at 8:02 AM, Emil Velikov <emil.l.velikov at gmail.com<mailto:emil.l.velikov at gmail.com>> wrote:

On 22 June 2017 at 22:13, Tim Rowley <timothy.o.rowley at intel.com<mailto:timothy.o.rowley at intel.com>> wrote:
Hardcode split to four files currently.  Decreases swr build
time on KNL by over 50%.
Out of curiosity what is KNL?

KNL is the Intel Xeon Phi x200 Processor family, codenamed Knights Landing, which has between 64 and 72 cores with AVX512.

Also, over 50% decrease - time to pop the champagne ;-)

---
src/gallium/drivers/swr/Makefile.am                |   36 +-
src/gallium/drivers/swr/Makefile.sources           |    2 +-
src/gallium/drivers/swr/SConscript                 |   24 +-
.../drivers/swr/rasterizer/codegen/gen_backends.py |   15 +-
.../codegen/templates/gen_rasterizer.cpp           |   42 +
src/gallium/drivers/swr/rasterizer/core/api.cpp    |    1 +
.../drivers/swr/rasterizer/core/multisample.cpp    |   48 -
.../drivers/swr/rasterizer/core/rasterizer.cpp     | 1788 +++-----------------
.../drivers/swr/rasterizer/core/rasterizer.h       |   31 +-
.../drivers/swr/rasterizer/core/rasterizer_impl.h  | 1376 +++++++++++++++
10 files changed, 1738 insertions(+), 1625 deletions(-)
create mode 100644 src/gallium/drivers/swr/rasterizer/codegen/templates/gen_rasterizer.cpp
delete mode 100644 src/gallium/drivers/swr/rasterizer/core/multisample.cpp
create mode 100644 src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h

diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
index 0daec90..1a69cfc 100644
--- a/src/gallium/drivers/swr/Makefile.am
+++ b/src/gallium/drivers/swr/Makefile.am
@@ -67,7 +67,12 @@ BUILT_SOURCES = \
       rasterizer/core/backends/gen_BackendPixelRate1.cpp \
       rasterizer/core/backends/gen_BackendPixelRate2.cpp \
       rasterizer/core/backends/gen_BackendPixelRate3.cpp \
-       rasterizer/core/backends/gen_BackendPixelRate.hpp
+       rasterizer/core/backends/gen_BackendPixelRate.hpp \
+       rasterizer/core/backends/gen_rasterizer0.cpp \
+       rasterizer/core/backends/gen_rasterizer1.cpp \
+       rasterizer/core/backends/gen_rasterizer2.cpp \
+       rasterizer/core/backends/gen_rasterizer3.cpp \
+       rasterizer/core/backends/gen_rasterizer.hpp

MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
@@ -170,6 +175,32 @@ backend.intermediate: rasterizer/codegen/gen_backends.py rasterizer/codegen/temp
               --cpp \
               --hpp

+rasterizer/core/backends/gen_rasterizer0.cpp \
+rasterizer/core/backends/gen_rasterizer1.cpp \
+rasterizer/core/backends/gen_rasterizer2.cpp \
+rasterizer/core/backends/gen_rasterizer3.cpp \
+rasterizer/core/backends/gen_rasterizer.hpp: \
+rasterizer.intermediate
+
+# 5 SWR_MULTISAMPLE_TYPE_COUNT
+# 2 CenterPattern
+# 2 Conservative
+# 3 SWR_INPUT_COVERAGE_COUNT
+# 5 STATE_VALID_TRI_EDGE_COUNT
+# 2 RasterScissorEdges
+
+.INTERMEDIATE: rasterizer.intermediate
Same question/suggestion as in PATCH 1 - please add a note (helps XXX) or drop

With that from build POV
Reviewed-by: Emil Velikov <emil.velikov at collabora.com<mailto:emil.velikov at collabora.com>>

Mentioned in my other mail that I’m not wed to the .INTERMEDIATE approach; I’ll address this the same way we decide upon for the backend split-up.


--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py

+
+    args = parser.parse_args(args)

-    args = parser.parse_args(args);

Unrelated cleanup?

I’ll try to pull the cleanups into a separate commit.


-Emil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170626/0c1f84f0/attachment-0001.html>


More information about the mesa-dev mailing list