From 382101bd05430d5d08d028d60272470572178e8b Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 3 Apr 2018 14:08:15 +0200 Subject: [PATCH] Run format_all.sh. --- format_all.sh | 3 ++- spirv_cfg.cpp | 2 +- spirv_cfg.hpp | 2 +- spirv_common.hpp | 4 ++-- spirv_cpp.hpp | 2 +- spirv_cross.hpp | 2 +- spirv_cross_util.cpp | 2 +- spirv_glsl.hpp | 2 +- spirv_hlsl.cpp | 4 ++-- spirv_hlsl.hpp | 2 +- spirv_msl.cpp | 13 ++++++------- spirv_msl.hpp | 5 +++-- 12 files changed, 22 insertions(+), 21 deletions(-) diff --git a/format_all.sh b/format_all.sh index 05efeb3..fcfffc5 100755 --- a/format_all.sh +++ b/format_all.sh @@ -1,6 +1,7 @@ #!/bin/bash -for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp +#for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp +for file in spirv_*.{cpp,hpp} main.cpp do echo "Formatting file: $file ..." clang-format -style=file -i $file diff --git a/spirv_cfg.cpp b/spirv_cfg.cpp index c76698a..aae31ca 100644 --- a/spirv_cfg.cpp +++ b/spirv_cfg.cpp @@ -226,4 +226,4 @@ void DominatorBuilder::lift_continue_block_dominator() if (back_edge_dominator) dominator = cfg.get_function().entry_block; } -} +} // namespace spirv_cross diff --git a/spirv_cfg.hpp b/spirv_cfg.hpp index 104e494..0df88e1 100644 --- a/spirv_cfg.hpp +++ b/spirv_cfg.hpp @@ -114,6 +114,6 @@ private: const CFG &cfg; uint32_t dominator = 0; }; -} +} // namespace spirv_cross #endif diff --git a/spirv_common.hpp b/spirv_common.hpp index 68870ff..d69fc19 100644 --- a/spirv_common.hpp +++ b/spirv_common.hpp @@ -92,7 +92,7 @@ void join_helper(std::ostringstream &stream, T &&t, Ts &&... ts) stream << std::forward(t); join_helper(stream, std::forward(ts)...); } -} +} // namespace inner class Bitset { @@ -1257,6 +1257,6 @@ static inline bool type_is_floating_point(const SPIRType &type) { return type.basetype == SPIRType::Half || type.basetype == SPIRType::Float || type.basetype == SPIRType::Double; } -} +} // namespace spirv_cross #endif diff --git a/spirv_cpp.hpp b/spirv_cpp.hpp index 802315a..a61dc8e 100644 --- a/spirv_cpp.hpp +++ b/spirv_cpp.hpp @@ -72,6 +72,6 @@ private: std::string interface_name; }; -} +} // namespace spirv_cross #endif diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 5436f5c..013f705 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -847,6 +847,6 @@ private: void fixup_type_alias(); bool type_is_block_like(const SPIRType &type) const; }; -} +} // namespace spirv_cross #endif diff --git a/spirv_cross_util.cpp b/spirv_cross_util.cpp index 5bc2f35..6a46c0d 100644 --- a/spirv_cross_util.cpp +++ b/spirv_cross_util.cpp @@ -48,4 +48,4 @@ void rename_interface_variable(spirv_cross::Compiler &compiler, const std::vecto compiler.set_name(v.id, name); } } -} +} // namespace spirv_cross_util diff --git a/spirv_glsl.hpp b/spirv_glsl.hpp index 5547a3b..ffe1f61 100644 --- a/spirv_glsl.hpp +++ b/spirv_glsl.hpp @@ -562,6 +562,6 @@ private: } } }; -} +} // namespace spirv_cross #endif diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp index 68f3b95..c7b0fda 100644 --- a/spirv_hlsl.cpp +++ b/spirv_hlsl.cpp @@ -1996,8 +1996,8 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret { // Manufacture automatic sampler arg for SampledImage texture decl += ", "; - decl += - join(arg_type.image.depth ? "SamplerComparisonState " : "SamplerState ", to_sampler_expression(arg.id), type_to_array_glsl(arg_type)); + decl += join(arg_type.image.depth ? "SamplerComparisonState " : "SamplerState ", + to_sampler_expression(arg.id), type_to_array_glsl(arg_type)); } if (&arg != &func.arguments.back()) diff --git a/spirv_hlsl.hpp b/spirv_hlsl.hpp index 10be651..80682f7 100644 --- a/spirv_hlsl.hpp +++ b/spirv_hlsl.hpp @@ -219,6 +219,6 @@ private: // when translating push constant ranges. std::vector root_constants_layout; }; -} +} // namespace spirv_cross #endif diff --git a/spirv_msl.cpp b/spirv_msl.cpp index 59ff02a..8882f9d 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -3224,10 +3224,8 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) auto &type = expression_type(arg.id); bool constref = !arg.alias_global_variable && (!type.pointer || arg.write_count == 0); - bool type_is_image = - type.basetype == SPIRType::Image || - type.basetype == SPIRType::SampledImage || - type.basetype == SPIRType::Sampler; + bool type_is_image = type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || + type.basetype == SPIRType::Sampler; // Arrays of images/samplers in MSL are always const. if (!type.array.empty() && type_is_image) @@ -3464,8 +3462,8 @@ std::string CompilerMSL::sampler_type(const SPIRType &type) parent = &get(parent->parent_type); parent = &get(parent->parent_type); - uint32_t array_size = type.array_size_literal.back() ? - type.array.back() : get(type.array.back()).scalar(); + uint32_t array_size = + type.array_size_literal.back() ? type.array.back() : get(type.array.back()).scalar(); if (array_size == 0) SPIRV_CROSS_THROW("Unsized array of samplers is not supported in MSL."); @@ -3486,7 +3484,8 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id) parent = &get(parent->parent_type); parent = &get(parent->parent_type); - uint32_t array_size = type.array_size_literal.back() ? type.array.back() : get(type.array.back()).scalar(); + uint32_t array_size = + type.array_size_literal.back() ? type.array.back() : get(type.array.back()).scalar(); if (array_size == 0) SPIRV_CROSS_THROW("Unsized array of images is not supported in MSL."); return join("array<", image_type_glsl(*parent, id), ", ", array_size, ">"); diff --git a/spirv_msl.hpp b/spirv_msl.hpp index ae343e0..25fbc87 100644 --- a/spirv_msl.hpp +++ b/spirv_msl.hpp @@ -77,7 +77,8 @@ public: // Options for compiling to Metal Shading Language struct Options { - typedef enum { + typedef enum + { iOS, macOS, } Platform; @@ -346,6 +347,6 @@ protected: SortAspect sort_aspect; }; }; -} +} // namespace spirv_cross #endif