From 7aaed915811e2745ba90e17eb0e3d03f6cf8c036 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Dec 2015 11:49:33 -0800 Subject: [PATCH] nir/spirv: Move to its own directory --- src/glsl/Makefile.am | 2 + src/glsl/Makefile.sources | 10 +- src/glsl/nir/{ => spirv}/nir_spirv.h | 0 src/glsl/nir/{ => spirv}/spirv.h | 0 src/glsl/nir/{ => spirv}/spirv_to_nir.c | 6 +- .../vtn_glsl450.c} | 4 +- .../vtn_private.h} | 4 +- src/glsl/nir/spirv2nir.c | 2 +- src/glsl/nir/spirv_glsl450.h | 127 ------------------ src/vulkan/anv_pipeline.c | 2 +- 10 files changed, 17 insertions(+), 140 deletions(-) rename src/glsl/nir/{ => spirv}/nir_spirv.h (100%) rename src/glsl/nir/{ => spirv}/spirv.h (100%) rename src/glsl/nir/{ => spirv}/spirv_to_nir.c (99%) rename src/glsl/nir/{spirv_glsl450_to_nir.c => spirv/vtn_glsl450.c} (99%) rename src/glsl/nir/{spirv_to_nir_private.h => spirv/vtn_private.h} (99%) delete mode 100644 src/glsl/nir/spirv_glsl450.h diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am index 8b0a73b250a..1396758b7c2 100644 --- a/src/glsl/Makefile.am +++ b/src/glsl/Makefile.am @@ -144,11 +144,13 @@ libglsl_la_SOURCES = \ glsl_parser.h \ $(LIBGLSL_FILES) \ $(NIR_FILES) \ + $(SPIRV_FILES) \ $(NIR_GENERATED_FILES) libnir_la_SOURCES = \ $(NIR_FILES) \ + $(SPIRV_FILES) \ $(NIR_GENERATED_FILES) glsl_compiler_SOURCES = \ diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index 830aacbe5e6..aa87cb1480f 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -79,7 +79,6 @@ NIR_FILES = \ nir/nir_remove_dead_variables.c \ nir/nir_search.c \ nir/nir_search.h \ - nir/nir_spirv.h \ nir/nir_split_var_copies.c \ nir/nir_sweep.c \ nir/nir_to_ssa.c \ @@ -90,9 +89,12 @@ NIR_FILES = \ nir/nir_worklist.h \ nir/nir_types.cpp \ nir/shader_enums.h \ - nir/shader_enums.c \ - nir/spirv_to_nir.c \ - nir/spirv_glsl450_to_nir.c + nir/shader_enums.c + +SPIRV_FILES = \ + nir/spirv/nir_spirv.h \ + nir/spirv/spirv_to_nir.c \ + nir/spirv/vtn_glsl450.c # libglsl diff --git a/src/glsl/nir/nir_spirv.h b/src/glsl/nir/spirv/nir_spirv.h similarity index 100% rename from src/glsl/nir/nir_spirv.h rename to src/glsl/nir/spirv/nir_spirv.h diff --git a/src/glsl/nir/spirv.h b/src/glsl/nir/spirv/spirv.h similarity index 100% rename from src/glsl/nir/spirv.h rename to src/glsl/nir/spirv/spirv.h diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c similarity index 99% rename from src/glsl/nir/spirv_to_nir.c rename to src/glsl/nir/spirv/spirv_to_nir.c index ad7a97cc948..815b447857b 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -25,9 +25,9 @@ * */ -#include "spirv_to_nir_private.h" -#include "nir_vla.h" -#include "nir_control_flow.h" +#include "vtn_private.h" +#include "nir/nir_vla.h" +#include "nir/nir_control_flow.h" static struct vtn_ssa_value * vtn_undef_ssa_value(struct vtn_builder *b, const struct glsl_type *type) diff --git a/src/glsl/nir/spirv_glsl450_to_nir.c b/src/glsl/nir/spirv/vtn_glsl450.c similarity index 99% rename from src/glsl/nir/spirv_glsl450_to_nir.c rename to src/glsl/nir/spirv/vtn_glsl450.c index ee1fca34c31..551f0540496 100644 --- a/src/glsl/nir/spirv_glsl450_to_nir.c +++ b/src/glsl/nir/spirv/vtn_glsl450.c @@ -25,8 +25,8 @@ * */ -#include "spirv_to_nir_private.h" -#include "spirv_glsl450.h" +#include "vtn_private.h" +#include "GLSL.std.450.h" static nir_ssa_def* build_length(nir_builder *b, nir_ssa_def *vec) diff --git a/src/glsl/nir/spirv_to_nir_private.h b/src/glsl/nir/spirv/vtn_private.h similarity index 99% rename from src/glsl/nir/spirv_to_nir_private.h rename to src/glsl/nir/spirv/vtn_private.h index 6b53fa3bfba..2fea244bb74 100644 --- a/src/glsl/nir/spirv_to_nir_private.h +++ b/src/glsl/nir/spirv/vtn_private.h @@ -25,9 +25,9 @@ * */ -#include "nir.h" +#include "nir/nir.h" +#include "nir/nir_builder.h" #include "nir_spirv.h" -#include "nir_builder.h" #include "spirv.h" struct vtn_builder; diff --git a/src/glsl/nir/spirv2nir.c b/src/glsl/nir/spirv2nir.c index e06e82595a2..6cf891517c7 100644 --- a/src/glsl/nir/spirv2nir.c +++ b/src/glsl/nir/spirv2nir.c @@ -31,7 +31,7 @@ * spirv_to_nir code. */ -#include "nir_spirv.h" +#include "spirv/nir_spirv.h" #include #include diff --git a/src/glsl/nir/spirv_glsl450.h b/src/glsl/nir/spirv_glsl450.h deleted file mode 100644 index d1c9b5c1d44..00000000000 --- a/src/glsl/nir/spirv_glsl450.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -** Copyright (c) 2014-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -const int GLSLstd450Version = 99; -const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 8da5da17e53..a6d62a3f49e 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -30,7 +30,7 @@ #include "anv_private.h" #include "brw_nir.h" #include "anv_nir.h" -#include "glsl/nir/nir_spirv.h" +#include "glsl/nir/spirv/nir_spirv.h" /* Needed for SWIZZLE macros */ #include "program/prog_instruction.h" -- 2.30.2