[Mesa-dev] [PATCH 2/2] swr: build driver proper separate from rasterizer

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 10 13:24:55 UTC 2017


Hi Tim,

On 7 July 2017 at 22:25, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> swr used to build and link the rasterizer to the driver, and to support
> multiple architectures we needed to have multiple versions of the
> driver/rasterizer combination, which needed to link in much of mesa.
>
> Changing to having one instance of the driver and just building
> architecture specific versions of the rasterizer gives a large reduction
> in disk space.
>
> libGL.so        6464 Kb ->  7000 Kb
> libswrAVX.so   10068 Kb ->  5432 Kb
> libswrAVX2.so   9828 Kb ->  5200 Kb
>
If one considers the other binaries which include libmesaswr.la
(swr_dri.so, osmesa, etc) savings might be a bit smaller ;-)
Regardless, thank you for working on this.

> Total          26360 Kb -> 17632 Kb
> ---
>  src/gallium/drivers/swr/Makefile.am     | 24 +++++++++++++-----------
>  src/gallium/drivers/swr/swr_context.cpp |  2 +-
>  src/gallium/drivers/swr/swr_loader.cpp  | 14 ++++++--------
>  src/gallium/drivers/swr/swr_screen.h    |  2 ++
>  4 files changed, 22 insertions(+), 20 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
> index 4b4bd37..e764e0d 100644
> --- a/src/gallium/drivers/swr/Makefile.am
> +++ b/src/gallium/drivers/swr/Makefile.am
> @@ -26,7 +26,13 @@ AM_CXXFLAGS = $(GALLIUM_DRIVER_CFLAGS) $(SWR_CXX11_CXXFLAGS)
>
>  noinst_LTLIBRARIES = libmesaswr.la
>
> -libmesaswr_la_SOURCES = $(LOADER_SOURCES)
> +libmesaswr_la_SOURCES = \

> +       $(COMMON_CXX_SOURCES) \
> +       rasterizer/codegen/gen_knobs.cpp \
> +       rasterizer/codegen/gen_knobs.h \
These three now seems to be duplicated across the frontend and
AVX/AVX2 backends. Is that intentional?
Worth adding a note?


> +libmesaswr_la_CXXFLAGS = \
> +       $(SWR_AVX_CXXFLAGS) \
> +       -DKNOB_ARCH=KNOB_ARCH_AVX \
With his KNOB, the frontend will be build for AVX. What about AVX2?


> -COMMON_LIBADD = \
> -       $(top_builddir)/src/gallium/auxiliary/libgallium.la \
> -       $(top_builddir)/src/mesa/libmesagallium.la \
> -       $(LLVM_LIBS)
> -
With this gone libswrAVX{,2}_la_LIBADD become empty, so we can drop them.

Can you check that configure --with-gallium-drivers=swr
--enable-gallium-osmesa --disable-dri --enable-glx=gallium-xlib build
fine (needs a second run dropping the latter two options). I cannot
spot anything obvious - just a gut feeling. You might want to sort the
SCons build as well?

Thanks
Emil


More information about the mesa-dev mailing list