Run format_all.sh.
This commit is contained in:
Родитель
1d082e9b79
Коммит
382101bd05
|
@ -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
|
||||
|
|
|
@ -226,4 +226,4 @@ void DominatorBuilder::lift_continue_block_dominator()
|
|||
if (back_edge_dominator)
|
||||
dominator = cfg.get_function().entry_block;
|
||||
}
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
|
|
@ -114,6 +114,6 @@ private:
|
|||
const CFG &cfg;
|
||||
uint32_t dominator = 0;
|
||||
};
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
||||
#endif
|
||||
|
|
|
@ -92,7 +92,7 @@ void join_helper(std::ostringstream &stream, T &&t, Ts &&... ts)
|
|||
stream << std::forward<T>(t);
|
||||
join_helper(stream, std::forward<Ts>(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
|
||||
|
|
|
@ -72,6 +72,6 @@ private:
|
|||
|
||||
std::string interface_name;
|
||||
};
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
||||
#endif
|
||||
|
|
|
@ -847,6 +847,6 @@ private:
|
|||
void fixup_type_alias();
|
||||
bool type_is_block_like(const SPIRType &type) const;
|
||||
};
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -562,6 +562,6 @@ private:
|
|||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -219,6 +219,6 @@ private:
|
|||
// when translating push constant ranges.
|
||||
std::vector<RootConstants> root_constants_layout;
|
||||
};
|
||||
}
|
||||
} // namespace spirv_cross
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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<SPIRType>(parent->parent_type);
|
||||
parent = &get<SPIRType>(parent->parent_type);
|
||||
|
||||
uint32_t array_size = type.array_size_literal.back() ?
|
||||
type.array.back() : get<SPIRConstant>(type.array.back()).scalar();
|
||||
uint32_t array_size =
|
||||
type.array_size_literal.back() ? type.array.back() : get<SPIRConstant>(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<SPIRType>(parent->parent_type);
|
||||
parent = &get<SPIRType>(parent->parent_type);
|
||||
|
||||
uint32_t array_size = type.array_size_literal.back() ? type.array.back() : get<SPIRConstant>(type.array.back()).scalar();
|
||||
uint32_t array_size =
|
||||
type.array_size_literal.back() ? type.array.back() : get<SPIRConstant>(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, ">");
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче