Commit af250a48 authored by Florian Oetke's avatar Florian Oetke
Browse files

fixed format (rerun clang-format)

parent 00a912d9
# additional target to perform clang-format run, requires clang-format
# get all project files
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h*)
file(GLOB_RECURSE ALL_SOURCE_FILES "${MIRRAGE_ROOT_DIR}/src/*.cpp" "${MIRRAGE_ROOT_DIR}/src/*.h*")
add_custom_target(
clangformat
......
......@@ -81,14 +81,14 @@ namespace mirrage::graphic {
template <Image_type Type>
class Texture : public detail::Base_texture {
protected:
Texture(Device& device,
Image_type type,
Image_dimensions sim,
std::int32_t mip_levels,
vk::Format format,
vk::ImageUsageFlags usage,
vk::ImageAspectFlags aspect,
bool dedicated)
Texture(Device& device,
Image_type type,
Image_dimensions sim,
std::int32_t mip_levels,
vk::Format format,
vk::ImageUsageFlags usage,
vk::ImageAspectFlags aspect,
bool dedicated)
: Base_texture(device, type, sim, mip_levels, format, usage, aspect, dedicated)
{
}
......@@ -115,12 +115,12 @@ namespace mirrage::graphic {
gsl::span<const std::uint8_t> data,
std::uint32_t owner_qfamily)
: Base_texture(device,
Type,
dim,
generate_mipmaps,
detail::format_from_channels(device, channels, srgb),
data,
owner_qfamily)
Type,
dim,
generate_mipmaps,
detail::format_from_channels(device, channels, srgb),
data,
owner_qfamily)
{
}
};
......
......@@ -181,7 +181,7 @@ namespace mirrage::input {
_pointer_world_pos[i] = _screen_to_world_coords(_pointer_screen_pos[i]);
for(auto& gp : _gamepads)
if(gp){
if(gp) {
gp->update(dt);
}
......
......@@ -12,8 +12,8 @@
#include <vulkan/vulkan.hpp>
#include <functional>
#include <variant>
#include <type_traits>
#include <variant>
namespace mirrage {
......
This diff is collapsed.
......@@ -82,8 +82,8 @@ namespace mirrage::renderer {
desc_set_layout};
auto pcs = vk::PushConstantRange{vk::ShaderStageFlagBits::eCompute, 0, sizeof(Push_constants)};
return renderer.device().vk_device()->createPipelineLayoutUnique(
vk::PipelineLayoutCreateInfo{{}, gsl::narrow<std::uint32_t>(dsl.size()), dsl.data(), 1, &pcs});
return renderer.device().vk_device()->createPipelineLayoutUnique(vk::PipelineLayoutCreateInfo{
{}, gsl::narrow<std::uint32_t>(dsl.size()), dsl.data(), 1, &pcs});
}
auto build_compute_pipeline(graphic::Device& device,
asset::Asset_manager& assets,
......@@ -105,8 +105,10 @@ namespace mirrage::renderer {
reinterpret_cast<float&>(spec_data[2 * 32]) = std::log(histogram_min);
reinterpret_cast<float&>(spec_data[3 * 32]) = std::log(histogram_max);
auto spec_info = vk::SpecializationInfo{
gsl::narrow<std::uint32_t>(spec_entries.size()), spec_entries.data(), gsl::narrow<std::uint32_t>(spec_data.size()), spec_data.data()};
auto spec_info = vk::SpecializationInfo{gsl::narrow<std::uint32_t>(spec_entries.size()),
spec_entries.data(),
gsl::narrow<std::uint32_t>(spec_data.size()),
spec_data.data()};
auto stage = vk::PipelineShaderStageCreateInfo{
{}, vk::ShaderStageFlagBits::eCompute, **module, "main", &spec_info};
......
......@@ -122,8 +122,9 @@ namespace mirrage::util {
std::piecewise_construct,
std::forward_as_tuple(name),
std::forward_as_tuple(name, api, [api, f = std::forward<F>(f)](std::string_view cmd) {
auto arg_iter = std::cregex_iterator(cmd.data(), cmd.data()+cmd.size(), split_args_regex);
auto arg_end = std::cregex_iterator();
auto arg_iter =
std::cregex_iterator(cmd.data(), cmd.data() + cmd.size(), split_args_regex);
auto arg_end = std::cregex_iterator();
util::foreach_function_arg_call(
f, [&](auto type) -> util::maybe<typename decltype(type)::type> {
......
......@@ -182,11 +182,11 @@ namespace mirrage::util {
/// The current index of the iterator into the pool-storage, as required by pool::get(...)
auto physical_index() const noexcept { return _physical_index; }
value_type& operator*() noexcept { return *get(); }
value_type* operator->() noexcept { return get(); }
value_type& operator*() noexcept { return *get(); }
value_type* operator->() noexcept { return get(); }
const value_type& operator*() const noexcept { return *get(); }
const value_type* operator->() const noexcept { return get(); }
const value_type* get() const noexcept;
const value_type* get() const noexcept;
value_type* get() noexcept;
auto operator++() -> pool_iterator&;
......
......@@ -193,7 +193,7 @@ namespace mirrage::util {
if constexpr(sizeof...(args) == 1 && std::is_same_v<T, first_arg_type>) {
// copy/move construction
auto&& first_arg = std::get<0>(std::forward_as_tuple(args...));
sort_key = first_arg.*(ValueTraits::sort_key);
sort_key = first_arg.*(ValueTraits::sort_key);
} else {
// normal constructor call
......
#include <mirrage/utils/log.hpp>
#ifdef MIRRAGE_ENABLE_BACKWARD
// TODO: remove after upstream is fixed
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma clang diagnostic ignored "-Wold-style-cast"
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
// TODO: remove after upstream is fixed
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma clang diagnostic ignored "-Wold-style-cast"
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
#include <backward.hpp>
#include <backward.hpp>
#ifdef __clang__
#pragma clang diagnostic pop
#else
#pragma GCC diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#else
#pragma GCC diagnostic pop
#endif
#endif
#include <sstream>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment