[Mesa-dev] [PATCH 4/9] compiler: introduce a libcompiler static library

Matt Turner mattst88 at gmail.com
Wed Nov 25 13:54:36 PST 2015


On Wed, Nov 25, 2015 at 1:31 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Currently it's an empty library, although it'll be used to store common
> code between GLSL and NIR that is compiler specific (rather than generic
> as the one in src/util).
>
> XXX: strictly speaking we could add a python/mako parser to generate the
> relevant files instead including builtin_type_macros.h in such a manner.

I don't think that's valuable. What we have now is a totally
appropriate use of the C preprocessor.

>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  configure.ac                                     |  1 +
>  src/Makefile.am                                  |  3 +++
>  src/compiler/Makefile.am                         | 25 ++++++++++++++++++++++++
>  src/compiler/Makefile.sources                    |  2 ++
>  src/{glsl/nir => compiler}/builtin_type_macros.h |  0
>  src/glsl/Makefile.sources                        |  1 -
>  src/glsl/builtin_types.cpp                       |  2 +-
>  src/glsl/nir/glsl_types.cpp                      |  2 +-
>  src/glsl/nir/glsl_types.h                        |  4 ++--
>  9 files changed, 35 insertions(+), 5 deletions(-)
>  create mode 100644 src/compiler/Makefile.am
>  create mode 100644 src/compiler/Makefile.sources
>  rename src/{glsl/nir => compiler}/builtin_type_macros.h (100%)
>
> diff --git a/configure.ac b/configure.ac
> index 4016871..fcffc19 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2346,6 +2346,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
>  dnl Substitute the config
>  AC_CONFIG_FILES([Makefile
>                 src/Makefile
> +               src/compiler/Makefile
>                 src/egl/Makefile
>                 src/egl/main/egl.pc
>                 src/egl/wayland/wayland-drm/Makefile
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 0d49bcd..6357d10 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -21,6 +21,9 @@
>
>  SUBDIRS = . gtest util mapi/glapi/gen mapi
>
> +# XXX: conditionally include

Conditionally on what? Seems like we're always going to want some kind
of shader compiler.

> +SUBDIRS += compiler
> +
>  if NEED_OPENGL_COMMON
>  SUBDIRS += glsl mesa
>  endif


More information about the mesa-dev mailing list