[Mesa-dev] [PATCH 7/9] compiler: move the glsl_types C wrapper
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 27 10:00:37 PST 2015
On Nov 25, 2015 1:27 PM, "Emil Velikov" <emil.l.velikov at gmail.com> wrote:
>
> From: Emil Velikov <emil.velikov at collabora.com>
>
> ... alongside its C++ brethren. On the flip side the files are called
> nir_types.{cpp,h} just because...
It does do one NIR-specific thing: if you call glsl_get_length on a matrix,
it gives you the number of columns. This probably isn't a huge deal though.
> At some point in the future we can fold the wrappers where they should
> be and rename things appropriately. Yet current direction is to try
> and split it out of nir.
>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> src/compiler/Makefile.sources | 2 ++
> src/{glsl/nir => compiler}/nir_types.cpp | 2 +-
> src/{glsl/nir => compiler}/nir_types.h | 3 ++-
> src/glsl/Makefile.sources | 4 +---
> src/glsl/nir/nir.h | 2 +-
> src/glsl/nir/nir_lower_var_copies.c | 2 +-
> 6 files changed, 8 insertions(+), 7 deletions(-)
> rename src/{glsl/nir => compiler}/nir_types.cpp (99%)
> rename src/{glsl/nir => compiler}/nir_types.h (98%)
>
> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
> index 38e75cf..e1228ca 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -2,5 +2,7 @@ LIBCOMPILER_FILES = \
> builtin_type_macros.h \
> glsl_types.cpp \
> glsl_types.h \
> + nir_types.cpp \
> + nir_types.h \
> shader_enums.c \
> shader_enums.h
> diff --git a/src/glsl/nir/nir_types.cpp b/src/compiler/nir_types.cpp
> similarity index 99%
> rename from src/glsl/nir/nir_types.cpp
> rename to src/compiler/nir_types.cpp
> index 135591a..4f89d20 100644
> --- a/src/glsl/nir/nir_types.cpp
> +++ b/src/compiler/nir_types.cpp
> @@ -25,8 +25,8 @@
> *
> */
>
> +#include "glsl/ir.h"
> #include "nir_types.h"
> -#include "ir.h"
>
> void
> glsl_print_type(const glsl_type *type, FILE *fp)
> diff --git a/src/glsl/nir/nir_types.h b/src/compiler/nir_types.h
> similarity index 98%
> rename from src/glsl/nir/nir_types.h
> rename to src/compiler/nir_types.h
> index 572cff2..b2245c2 100644
> --- a/src/glsl/nir/nir_types.h
> +++ b/src/compiler/nir_types.h
> @@ -28,10 +28,11 @@
> #pragma once
>
> #include <stdio.h>
> +#include <stdbool.h>
>
> /* C wrapper around compiler/glsl_types.h */
>
> -#include "compiler/glsl_types.h"
> +#include "glsl_types.h"
>
> #ifdef __cplusplus
> extern "C" {
> diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
> index 80cbd76..5bf6486 100644
> --- a/src/glsl/Makefile.sources
> +++ b/src/glsl/Makefile.sources
> @@ -76,12 +76,10 @@ NIR_FILES = \
> nir/nir_split_var_copies.c \
> nir/nir_sweep.c \
> nir/nir_to_ssa.c \
> - nir/nir_types.h \
> nir/nir_validate.c \
> nir/nir_vla.h \
> nir/nir_worklist.c \
> - nir/nir_worklist.h \
> - nir/nir_types.cpp
> + nir/nir_worklist.h
>
> # libglsl
>
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index e69b3c8..7e99a7b 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -34,7 +34,7 @@
> #include "util/ralloc.h"
> #include "util/set.h"
> #include "util/bitset.h"
> -#include "nir_types.h"
> +#include "compiler/nir_types.h"
> #include "compiler/shader_enums.h"
> #include <stdio.h>
>
> diff --git a/src/glsl/nir/nir_lower_var_copies.c
b/src/glsl/nir/nir_lower_var_copies.c
> index 98c107a..f5a5815 100644
> --- a/src/glsl/nir/nir_lower_var_copies.c
> +++ b/src/glsl/nir/nir_lower_var_copies.c
> @@ -25,8 +25,8 @@
> *
> */
>
> +#include "compiler/nir_types.h"
> #include "nir.h"
> -#include "nir_types.h"
>
> /*
> * Lowers all copy intrinsics to sequences of load/store intrinsics.
> --
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151127/a137bc36/attachment-0001.html>
More information about the mesa-dev
mailing list