From 301e4c46a0dc6c37e79daf193483b4a50c30716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 5 Dec 2020 19:13:26 -0800 Subject: [PATCH] Updated spirv-cross. --- 3rdparty/spirv-cross/main.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cfg.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cfg.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_common.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cpp.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cpp.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_c.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_c.h | 7 +++++++ .../spirv-cross/spirv_cross_containers.hpp | 7 +++++++ .../spirv-cross/spirv_cross_error_handling.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_util.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_cross_util.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_glsl.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_glsl.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_hlsl.cpp | 8 ++++++++ 3rdparty/spirv-cross/spirv_hlsl.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_msl.cpp | 18 ++++++++++++++++-- 3rdparty/spirv-cross/spirv_msl.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_parser.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_parser.hpp | 7 +++++++ 3rdparty/spirv-cross/spirv_reflect.cpp | 7 +++++++ 3rdparty/spirv-cross/spirv_reflect.hpp | 7 +++++++ 26 files changed, 192 insertions(+), 2 deletions(-) diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index 59f4bd502..6f511358b 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cpp.hpp" #include "spirv_cross_util.hpp" #include "spirv_glsl.hpp" diff --git a/3rdparty/spirv-cross/spirv_cfg.cpp b/3rdparty/spirv-cross/spirv_cfg.cpp index 9973fbae1..fa9f3d173 100644 --- a/3rdparty/spirv-cross/spirv_cfg.cpp +++ b/3rdparty/spirv-cross/spirv_cfg.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cfg.hpp" #include "spirv_cross.hpp" #include diff --git a/3rdparty/spirv-cross/spirv_cfg.hpp b/3rdparty/spirv-cross/spirv_cfg.hpp index 9f3e62a1b..b54599339 100644 --- a/3rdparty/spirv-cross/spirv_cfg.hpp +++ b/3rdparty/spirv-cross/spirv_cfg.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_CFG_HPP #define SPIRV_CROSS_CFG_HPP diff --git a/3rdparty/spirv-cross/spirv_common.hpp b/3rdparty/spirv-cross/spirv_common.hpp index d13b55e50..ecb840772 100644 --- a/3rdparty/spirv-cross/spirv_common.hpp +++ b/3rdparty/spirv-cross/spirv_common.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_COMMON_HPP #define SPIRV_CROSS_COMMON_HPP diff --git a/3rdparty/spirv-cross/spirv_cpp.cpp b/3rdparty/spirv-cross/spirv_cpp.cpp index d13d6006a..492044314 100644 --- a/3rdparty/spirv-cross/spirv_cpp.cpp +++ b/3rdparty/spirv-cross/spirv_cpp.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cpp.hpp" using namespace spv; diff --git a/3rdparty/spirv-cross/spirv_cpp.hpp b/3rdparty/spirv-cross/spirv_cpp.hpp index e78d0369f..686624063 100644 --- a/3rdparty/spirv-cross/spirv_cpp.hpp +++ b/3rdparty/spirv-cross/spirv_cpp.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_CPP_HPP #define SPIRV_CROSS_CPP_HPP diff --git a/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/spirv-cross/spirv_cross.cpp index 21d2f2fcd..5c1b3ebc5 100644 --- a/3rdparty/spirv-cross/spirv_cross.cpp +++ b/3rdparty/spirv-cross/spirv_cross.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cross.hpp" #include "GLSL.std.450.h" #include "spirv_cfg.hpp" diff --git a/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/spirv-cross/spirv_cross.hpp index f20ed4269..47f1d7949 100644 --- a/3rdparty/spirv-cross/spirv_cross.hpp +++ b/3rdparty/spirv-cross/spirv_cross.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_HPP #define SPIRV_CROSS_HPP diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index d90d40abb..a3a302105 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cross_c.h" #if SPIRV_CROSS_C_API_CPP diff --git a/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/spirv-cross/spirv_cross_c.h index 88f04aaa2..62d91c195 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.h +++ b/3rdparty/spirv-cross/spirv_cross_c.h @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_C_API_H #define SPIRV_CROSS_C_API_H diff --git a/3rdparty/spirv-cross/spirv_cross_containers.hpp b/3rdparty/spirv-cross/spirv_cross_containers.hpp index 357ae6227..c68f670b1 100644 --- a/3rdparty/spirv-cross/spirv_cross_containers.hpp +++ b/3rdparty/spirv-cross/spirv_cross_containers.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_CONTAINERS_HPP #define SPIRV_CROSS_CONTAINERS_HPP diff --git a/3rdparty/spirv-cross/spirv_cross_error_handling.hpp b/3rdparty/spirv-cross/spirv_cross_error_handling.hpp index fa90610b5..c0927e459 100644 --- a/3rdparty/spirv-cross/spirv_cross_error_handling.hpp +++ b/3rdparty/spirv-cross/spirv_cross_error_handling.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_ERROR_HANDLING #define SPIRV_CROSS_ERROR_HANDLING diff --git a/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp b/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp index 1a67fa472..ff1b63fbc 100644 --- a/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp +++ b/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cross_parsed_ir.hpp" #include #include diff --git a/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp b/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp index c6c71706d..ee202d2fa 100644 --- a/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp +++ b/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_PARSED_IR_HPP #define SPIRV_CROSS_PARSED_IR_HPP diff --git a/3rdparty/spirv-cross/spirv_cross_util.cpp b/3rdparty/spirv-cross/spirv_cross_util.cpp index cfad676ec..f9b5c5f9a 100644 --- a/3rdparty/spirv-cross/spirv_cross_util.cpp +++ b/3rdparty/spirv-cross/spirv_cross_util.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_cross_util.hpp" #include "spirv_common.hpp" diff --git a/3rdparty/spirv-cross/spirv_cross_util.hpp b/3rdparty/spirv-cross/spirv_cross_util.hpp index 708b7cb56..b0501f33b 100644 --- a/3rdparty/spirv-cross/spirv_cross_util.hpp +++ b/3rdparty/spirv-cross/spirv_cross_util.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_UTIL_HPP #define SPIRV_CROSS_UTIL_HPP diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 62538c4f2..f1653e221 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_glsl.hpp" #include "GLSL.std.450.h" #include "spirv_common.hpp" diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index fe0f76d0e..3c41efef7 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_GLSL_HPP #define SPIRV_CROSS_GLSL_HPP diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 8a1520bac..94210e73c 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -12,6 +12,14 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * + */ + +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. */ #include "spirv_hlsl.hpp" diff --git a/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/spirv-cross/spirv_hlsl.hpp index 4abb203b2..84e75e913 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_HLSL_HPP #define SPIRV_HLSL_HPP diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index a9ec650c5..b0709d590 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_msl.hpp" #include "GLSL.std.450.h" @@ -12019,6 +12026,8 @@ void CompilerMSL::replace_illegal_names() "main", "saturate", "assert", + "fmin3", + "fmax3", "VARIABLE_TRACEPOINT", "STATIC_DATA_TRACEPOINT", "STATIC_DATA_TRACEPOINT_V", @@ -13319,12 +13328,17 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin) SPIRV_CROSS_THROW("thread_index_in_simdgroup requires Metal 2.2 in fragment shaders."); return "thread_index_in_simdgroup"; } - else + else if (execution.model == ExecutionModelKernel || execution.model == ExecutionModelGLCompute || + execution.model == ExecutionModelTessellationControl || + (execution.model == ExecutionModelVertex && msl_options.vertex_for_tessellation)) { + // We are generating a Metal kernel function. if (!msl_options.supports_msl_version(2)) - SPIRV_CROSS_THROW("Subgroup builtins require Metal 2.0."); + SPIRV_CROSS_THROW("Subgroup builtins in kernel functions require Metal 2.0."); return msl_options.is_ios() ? "thread_index_in_quadgroup" : "thread_index_in_simdgroup"; } + else + SPIRV_CROSS_THROW("Subgroup builtins are not available in this type of function."); case BuiltInSubgroupEqMask: case BuiltInSubgroupGeMask: diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 61d4fbeab..003fb83ae 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_MSL_HPP #define SPIRV_CROSS_MSL_HPP diff --git a/3rdparty/spirv-cross/spirv_parser.cpp b/3rdparty/spirv-cross/spirv_parser.cpp index 92db5287a..b7144c910 100644 --- a/3rdparty/spirv-cross/spirv_parser.cpp +++ b/3rdparty/spirv-cross/spirv_parser.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_parser.hpp" #include diff --git a/3rdparty/spirv-cross/spirv_parser.hpp b/3rdparty/spirv-cross/spirv_parser.hpp index 7b3eddedd..190266a4e 100644 --- a/3rdparty/spirv-cross/spirv_parser.hpp +++ b/3rdparty/spirv-cross/spirv_parser.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_PARSER_HPP #define SPIRV_CROSS_PARSER_HPP diff --git a/3rdparty/spirv-cross/spirv_reflect.cpp b/3rdparty/spirv-cross/spirv_reflect.cpp index dbe837f2a..90dc62bd3 100644 --- a/3rdparty/spirv-cross/spirv_reflect.cpp +++ b/3rdparty/spirv-cross/spirv_reflect.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #include "spirv_reflect.hpp" #include "spirv_glsl.hpp" #include diff --git a/3rdparty/spirv-cross/spirv_reflect.hpp b/3rdparty/spirv-cross/spirv_reflect.hpp index 9f60e72ee..d82c0de7d 100644 --- a/3rdparty/spirv-cross/spirv_reflect.hpp +++ b/3rdparty/spirv-cross/spirv_reflect.hpp @@ -14,6 +14,13 @@ * limitations under the License. */ +/* + * At your option, you may choose to accept this material under either: + * 1. The Apache License, Version 2.0, found at , or + * 2. The MIT License, found at . + * SPDX-License-Identifier: Apache-2.0 OR MIT. + */ + #ifndef SPIRV_CROSS_REFLECT_HPP #define SPIRV_CROSS_REFLECT_HPP