From eab0833b82fb2735ea2faf288e8725bb8f994201 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: Fri, 15 Jan 2021 20:33:57 -0800 Subject: [PATCH] Updated spirv-cross. --- 3rdparty/spirv-cross/main.cpp | 2 +- 3rdparty/spirv-cross/spirv_cfg.cpp | 2 +- 3rdparty/spirv-cross/spirv_cfg.hpp | 2 +- 3rdparty/spirv-cross/spirv_common.hpp | 2 +- 3rdparty/spirv-cross/spirv_cpp.cpp | 2 +- 3rdparty/spirv-cross/spirv_cpp.hpp | 2 +- 3rdparty/spirv-cross/spirv_cross.cpp | 18 +++++++++++++----- 3rdparty/spirv-cross/spirv_cross.hpp | 2 +- 3rdparty/spirv-cross/spirv_cross_c.cpp | 2 +- 3rdparty/spirv-cross/spirv_cross_c.h | 2 +- .../spirv-cross/spirv_cross_containers.hpp | 2 +- .../spirv-cross/spirv_cross_error_handling.hpp | 2 +- 3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp | 2 +- 3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp | 2 +- 3rdparty/spirv-cross/spirv_cross_util.cpp | 2 +- 3rdparty/spirv-cross/spirv_cross_util.hpp | 2 +- 3rdparty/spirv-cross/spirv_glsl.cpp | 2 +- 3rdparty/spirv-cross/spirv_glsl.hpp | 2 +- 3rdparty/spirv-cross/spirv_hlsl.cpp | 2 +- 3rdparty/spirv-cross/spirv_hlsl.hpp | 2 +- 3rdparty/spirv-cross/spirv_msl.cpp | 2 +- 3rdparty/spirv-cross/spirv_msl.hpp | 2 +- 3rdparty/spirv-cross/spirv_parser.cpp | 2 +- 3rdparty/spirv-cross/spirv_parser.hpp | 2 +- 3rdparty/spirv-cross/spirv_reflect.cpp | 2 +- 3rdparty/spirv-cross/spirv_reflect.hpp | 2 +- 26 files changed, 38 insertions(+), 30 deletions(-) diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index 2d50e1b72..2b99022e7 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cfg.cpp b/3rdparty/spirv-cross/spirv_cfg.cpp index fa9f3d173..0a66d60bd 100644 --- a/3rdparty/spirv-cross/spirv_cfg.cpp +++ b/3rdparty/spirv-cross/spirv_cfg.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 Arm Limited + * Copyright 2016-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cfg.hpp b/3rdparty/spirv-cross/spirv_cfg.hpp index b54599339..041526d65 100644 --- a/3rdparty/spirv-cross/spirv_cfg.hpp +++ b/3rdparty/spirv-cross/spirv_cfg.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 Arm Limited + * Copyright 2016-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_common.hpp b/3rdparty/spirv-cross/spirv_common.hpp index 8e3b13739..128c41627 100644 --- a/3rdparty/spirv-cross/spirv_common.hpp +++ b/3rdparty/spirv-cross/spirv_common.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cpp.cpp b/3rdparty/spirv-cross/spirv_cpp.cpp index 492044314..e95fe00ee 100644 --- a/3rdparty/spirv-cross/spirv_cpp.cpp +++ b/3rdparty/spirv-cross/spirv_cpp.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cpp.hpp b/3rdparty/spirv-cross/spirv_cpp.hpp index 686624063..a3bf0edb3 100644 --- a/3rdparty/spirv-cross/spirv_cpp.hpp +++ b/3rdparty/spirv-cross/spirv_cpp.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/spirv-cross/spirv_cross.cpp index d814cd64d..199d0fd25 100644 --- a/3rdparty/spirv-cross/spirv_cross.cpp +++ b/3rdparty/spirv-cross/spirv_cross.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2829,7 +2829,8 @@ const SPIRConstant &Compiler::get_constant(ConstantID id) const return get(id); } -static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block, const unordered_set &blocks) +static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block, const unordered_set &blocks, + unordered_set &visit_cache) { // This block accesses the variable. if (blocks.find(block) != end(blocks)) @@ -2841,8 +2842,14 @@ static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block, con // If any of our successors have a path to the end, there exists a path from block. for (auto &succ : cfg.get_succeeding_edges(block)) - if (exists_unaccessed_path_to_return(cfg, succ, blocks)) - return true; + { + if (visit_cache.count(succ) == 0) + { + if (exists_unaccessed_path_to_return(cfg, succ, blocks, visit_cache)) + return true; + visit_cache.insert(succ); + } + } return false; } @@ -2899,7 +2906,8 @@ void Compiler::analyze_parameter_preservation( // void foo(int &var) { if (cond) var = 10; } // Using read/write counts, we will think it's just an out variable, but it really needs to be inout, // because if we don't write anything whatever we put into the function must return back to the caller. - if (exists_unaccessed_path_to_return(cfg, entry.entry_block, itr->second)) + unordered_set visit_cache; + if (exists_unaccessed_path_to_return(cfg, entry.entry_block, itr->second, visit_cache)) arg.read_count++; } } diff --git a/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/spirv-cross/spirv_cross.hpp index 016d13e53..c29ce6b47 100644 --- a/3rdparty/spirv-cross/spirv_cross.hpp +++ b/3rdparty/spirv-cross/spirv_cross.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index a3a302105..a542346ee 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Hans-Kristian Arntzen + * Copyright 2019-2021 Hans-Kristian Arntzen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/spirv-cross/spirv_cross_c.h index 62d91c195..811bb8cf0 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.h +++ b/3rdparty/spirv-cross/spirv_cross_c.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Hans-Kristian Arntzen + * Copyright 2019-2021 Hans-Kristian Arntzen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_containers.hpp b/3rdparty/spirv-cross/spirv_cross_containers.hpp index c68f670b1..b9c3737c9 100644 --- a/3rdparty/spirv-cross/spirv_cross_containers.hpp +++ b/3rdparty/spirv-cross/spirv_cross_containers.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Hans-Kristian Arntzen + * Copyright 2019-2021 Hans-Kristian Arntzen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_error_handling.hpp b/3rdparty/spirv-cross/spirv_cross_error_handling.hpp index c0927e459..32af107eb 100644 --- a/3rdparty/spirv-cross/spirv_cross_error_handling.hpp +++ b/3rdparty/spirv-cross/spirv_cross_error_handling.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp b/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp index a9ade42b1..e1a13c5e0 100644 --- a/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp +++ b/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Arm Limited + * Copyright 2018-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp b/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp index ca37a9bcd..88a069196 100644 --- a/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp +++ b/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Arm Limited + * Copyright 2018-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_util.cpp b/3rdparty/spirv-cross/spirv_cross_util.cpp index f9b5c5f9a..9ce6d4fb7 100644 --- a/3rdparty/spirv-cross/spirv_cross_util.cpp +++ b/3rdparty/spirv-cross/spirv_cross_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_cross_util.hpp b/3rdparty/spirv-cross/spirv_cross_util.hpp index b0501f33b..daa4a7900 100644 --- a/3rdparty/spirv-cross/spirv_cross_util.hpp +++ b/3rdparty/spirv-cross/spirv_cross_util.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 7a740711c..0b93413a6 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index a32edc0a5..beb8a8fb0 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 Arm Limited + * Copyright 2015-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 24eae9985..c080ff663 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 Robert Konrad + * Copyright 2016-2021 Robert Konrad * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/spirv-cross/spirv_hlsl.hpp index 4b481ddda..f46b1868a 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 Robert Konrad + * Copyright 2016-2021 Robert Konrad * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index a66945700..3d60d38a1 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The Brenwill Workshop Ltd. + * Copyright 2016-2021 The Brenwill Workshop Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 8c7861236..0cce958d2 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The Brenwill Workshop Ltd. + * Copyright 2016-2021 The Brenwill Workshop Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_parser.cpp b/3rdparty/spirv-cross/spirv_parser.cpp index eff50dd30..7159a3257 100644 --- a/3rdparty/spirv-cross/spirv_parser.cpp +++ b/3rdparty/spirv-cross/spirv_parser.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Arm Limited + * Copyright 2018-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_parser.hpp b/3rdparty/spirv-cross/spirv_parser.hpp index 190266a4e..7f4a7d856 100644 --- a/3rdparty/spirv-cross/spirv_parser.hpp +++ b/3rdparty/spirv-cross/spirv_parser.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Arm Limited + * Copyright 2018-2021 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_reflect.cpp b/3rdparty/spirv-cross/spirv_reflect.cpp index 90dc62bd3..447bff1c9 100644 --- a/3rdparty/spirv-cross/spirv_reflect.cpp +++ b/3rdparty/spirv-cross/spirv_reflect.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Bradley Austin Davis + * Copyright 2018-2021 Bradley Austin Davis * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/3rdparty/spirv-cross/spirv_reflect.hpp b/3rdparty/spirv-cross/spirv_reflect.hpp index d82c0de7d..8acbd2804 100644 --- a/3rdparty/spirv-cross/spirv_reflect.hpp +++ b/3rdparty/spirv-cross/spirv_reflect.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 Bradley Austin Davis + * Copyright 2018-2021 Bradley Austin Davis * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.