Applied clang-format-18 to codebase

This commit is contained in:
OpenSauce04
2024-11-10 21:02:54 +00:00
parent 3e02c29225
commit fd55b4fd6c
148 changed files with 1028 additions and 1029 deletions

View File

@@ -43,8 +43,8 @@ struct GPU::Impl {
: timing{system.CoreTiming()}, system{system}, memory{system.Memory()},
debug_context{Pica::g_debug_context}, pica{memory, debug_context},
renderer{VideoCore::CreateRenderer(emu_window, secondary_window, pica, system)},
rasterizer{renderer->Rasterizer()}, sw_blitter{std::make_unique<SwRenderer::SwBlitter>(
memory, rasterizer)} {}
rasterizer{renderer->Rasterizer()},
sw_blitter{std::make_unique<SwRenderer::SwBlitter>(memory, rasterizer)} {}
~Impl() = default;
};

View File

@@ -390,7 +390,7 @@ void GeometryPipeline::SubmitVertex(const AttributeBuffer& input) {
template <class Archive>
void GeometryPipeline::serialize(Archive& ar, const unsigned int version) {
// vertex_handler and shader_engine are always set to the same value
ar& backend;
ar & backend;
}
} // namespace Pica

View File

@@ -32,14 +32,14 @@ struct OutputVertex {
private:
template <class Archive>
void serialize(Archive& ar, const u32) {
ar& pos;
ar& quat;
ar& color;
ar& tc0;
ar& tc1;
ar& tc0_w;
ar& view;
ar& tc2;
ar & pos;
ar & quat;
ar & color;
ar & tc0;
ar & tc1;
ar & tc0_w;
ar & view;
ar & tc2;
}
friend class boost::serialization::access;
};

View File

@@ -65,8 +65,8 @@ private:
private:
template <class Archive>
void serialize(Archive& ar, const u32) {
ar& buffer;
ar& index;
ar & buffer;
ar & index;
}
friend class boost::serialization::access;
};

View File

@@ -31,9 +31,8 @@ union CommandHeader {
static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext> debug_context_)
: memory{memory_}, debug_context{std::move(debug_context_)}, geometry_pipeline{regs.internal,
gs_unit,
gs_setup},
: memory{memory_}, debug_context{std::move(debug_context_)},
geometry_pipeline{regs.internal, gs_unit, gs_setup},
shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} {
InitializeRegs();
@@ -613,9 +612,9 @@ void PicaCore::LoadVertices(bool is_indexed) {
template <class Archive>
void PicaCore::CommandList::serialize(Archive& ar, const u32 file_version) {
ar& addr;
ar& length;
ar& current_index;
ar & addr;
ar & length;
ar & current_index;
if (Archive::is_loading::value) {
const u8* ptr = Core::System::GetInstance().Memory().GetPhysicalPointer(addr);
head = reinterpret_cast<const u32*>(ptr);

View File

@@ -109,10 +109,10 @@ public:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& input_vertex;
ar& current_attribute;
ar& reset_geometry_pipeline;
ar& queue;
ar & input_vertex;
ar & current_attribute;
ar & reset_geometry_pipeline;
ar & queue;
}
};
@@ -199,7 +199,7 @@ public:
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& raw;
ar & raw;
}
};
@@ -256,19 +256,19 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& regs_lcd;
ar& regs.reg_array;
ar& gs_unit;
ar& vs_setup;
ar& gs_setup;
ar& proctex;
ar& lighting;
ar& fog;
ar& input_default_attributes;
ar& immediate;
ar& geometry_pipeline;
ar& primitive_assembler;
ar& cmd_list;
ar & regs_lcd;
ar & regs.reg_array;
ar & gs_unit;
ar & vs_setup;
ar & gs_setup;
ar & proctex;
ar & lighting;
ar & fog;
ar & input_default_attributes;
ar & immediate;
ar & geometry_pipeline;
ar & primitive_assembler;
ar & cmd_list;
}
private:

View File

@@ -80,11 +80,11 @@ private:
template <class Archive>
void serialize(Archive& ar, const unsigned int version) {
ar& topology;
ar& buffer_index;
ar& buffer;
ar& strip_ready;
ar& winding;
ar & topology;
ar & buffer_index;
ar & buffer;
ar & strip_ready;
ar & winding;
}
friend class boost::serialization::access;
};

View File

@@ -56,10 +56,10 @@ struct RegsLcd {
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& color_fill_top.raw;
ar& backlight_top;
ar& color_fill_bottom.raw;
ar& backlight_bottom;
ar & color_fill_top.raw;
ar & backlight_top;
ar & color_fill_bottom.raw;
ar & backlight_bottom;
}
friend class boost::serialization::access;
};

View File

@@ -38,9 +38,9 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& f;
ar& b;
ar& i;
ar & f;
ar & b;
ar & i;
}
};
@@ -90,14 +90,14 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& uniforms;
ar& uniform_queue;
ar& program_code;
ar& swizzle_data;
ar& program_code_hash_dirty;
ar& swizzle_data_hash_dirty;
ar& program_code_hash;
ar& swizzle_data_hash;
ar & uniforms;
ar & uniform_queue;
ar & program_code;
ar & swizzle_data;
ar & program_code_hash_dirty;
ar & swizzle_data_hash_dirty;
ar & program_code_hash;
ar & swizzle_data_hash;
}
};

View File

@@ -57,11 +57,11 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& input;
ar& temporary;
ar& output;
ar& conditional_code;
ar& address_registers;
ar & input;
ar & temporary;
ar & output;
ar & conditional_code;
ar & address_registers;
}
};
@@ -86,11 +86,11 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& buffer;
ar& vertex_id;
ar& prim_emit;
ar& winding;
ar& output_mask;
ar & buffer;
ar & vertex_id;
ar & prim_emit;
ar & winding;
ar & output_mask;
}
};
@@ -113,7 +113,7 @@ private:
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& boost::serialization::base_object<ShaderUnit>(*this);
ar& emitter;
ar & emitter;
}
};

View File

@@ -149,7 +149,7 @@ private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) {
ar& value;
ar & value;
}
};

View File

@@ -55,12 +55,12 @@ OGLProgram CreateProgram(std::string_view frag) {
BlitHelper::BlitHelper(const Driver& driver_)
: driver{driver_}, linear_sampler{CreateSampler(GL_LINEAR)},
nearest_sampler{CreateSampler(GL_NEAREST)}, bicubic_program{CreateProgram(
HostShaders::BICUBIC_FRAG)},
nearest_sampler{CreateSampler(GL_NEAREST)},
bicubic_program{CreateProgram(HostShaders::BICUBIC_FRAG)},
scale_force_program{CreateProgram(HostShaders::SCALE_FORCE_FRAG)},
xbrz_program{CreateProgram(HostShaders::XBRZ_FREESCALE_FRAG)},
mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)}, gradient_x_program{CreateProgram(
HostShaders::X_GRADIENT_FRAG)},
mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)},
gradient_x_program{CreateProgram(HostShaders::X_GRADIENT_FRAG)},
gradient_y_program{CreateProgram(HostShaders::Y_GRADIENT_FRAG)},
refine_program{CreateProgram(HostShaders::REFINE_FRAG)},
d24s8_to_rgba8{CreateProgram(HostShaders::D24S8_TO_RGBA8_FRAG)},

View File

@@ -970,10 +970,9 @@ void RasterizerOpenGL::SyncAndUploadLUTsLF() {
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
std::array<Common::Vec2f, 128> new_data;
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
[](const auto& entry) {
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()};
});
std::transform(
pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
[](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
if (new_data != fog_lut_data || invalidate) {
fog_lut_data = new_data;

View File

@@ -331,8 +331,8 @@ public:
ShaderProgramManager::ShaderProgramManager(Frontend::EmuWindow& emu_window_, const Driver& driver_,
bool separable)
: emu_window{emu_window_}, driver{driver_},
strict_context_required{emu_window.StrictContextRequired()}, impl{std::make_unique<Impl>(
driver_, separable)} {}
strict_context_required{emu_window.StrictContextRequired()},
impl{std::make_unique<Impl>(driver_, separable)} {}
ShaderProgramManager::~ShaderProgramManager() = default;

View File

@@ -602,8 +602,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
const Surface* color, const Surface* depth)
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale
: (depth ? depth->res_scale : 1u)} {
: VideoCore::FramebufferParams{params},
res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
if (shadow_rendering && !color) {
return;

View File

@@ -75,9 +75,8 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons
RendererOpenGL::RendererOpenGL(Core::System& system, Pica::PicaCore& pica_,
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
: VideoCore::RendererBase{system, window, secondary_window}, pica{pica_},
rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver}, frame_dumper{
system,
window} {
rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver},
frame_dumper{system, window} {
const bool has_debug_tool = driver.HasDebugTool();
window.mailbox = std::make_unique<OGLTextureMailbox>(has_debug_tool);
if (secondary_window) {

View File

@@ -132,16 +132,16 @@ std::string GetReadableVersion(u32 version) {
} // Anonymous namespace
Instance::Instance(bool enable_validation, bool dump_command_buffers)
: library{OpenLibrary()}, instance{CreateInstance(*library,
Frontend::WindowSystemType::Headless,
enable_validation, dump_command_buffers)},
: library{OpenLibrary()},
instance{CreateInstance(*library, Frontend::WindowSystemType::Headless, enable_validation,
dump_command_buffers)},
physical_devices{instance->enumeratePhysicalDevices()} {}
Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
: library{OpenLibrary(&window)}, instance{CreateInstance(
*library, window.GetWindowInfo().type,
Settings::values.renderer_debug.GetValue(),
Settings::values.dump_command_buffers.GetValue())},
: library{OpenLibrary(&window)},
instance{CreateInstance(*library, window.GetWindowInfo().type,
Settings::values.renderer_debug.GetValue(),
Settings::values.dump_command_buffers.GetValue())},
debug_callback{CreateDebugCallback(*instance, debug_utils_supported)},
physical_devices{instance->enumeratePhysicalDevices()} {
const std::size_t num_physical_devices = static_cast<u16>(physical_devices.size());

View File

@@ -100,9 +100,9 @@ bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, vk::Format fo
PresentWindow::PresentWindow(Frontend::EmuWindow& emu_window_, const Instance& instance_,
Scheduler& scheduler_)
: emu_window{emu_window_}, instance{instance_}, scheduler{scheduler_},
surface{CreateSurface(instance.GetInstance(), emu_window)},
next_surface{surface}, swapchain{instance, emu_window.GetFramebufferLayout().width,
emu_window.GetFramebufferLayout().height, surface},
surface{CreateSurface(instance.GetInstance(), emu_window)}, next_surface{surface},
swapchain{instance, emu_window.GetFramebufferLayout().width,
emu_window.GetFramebufferLayout().height, surface},
graphics_queue{instance.GetGraphicsQueue()}, present_renderpass{CreateRenderpass()},
vsync_enabled{Settings::values.use_vsync_new.GetValue()},
blit_supported{

View File

@@ -62,11 +62,8 @@ RasterizerVulkan::RasterizerVulkan(Memory::MemorySystem& memory, Pica::PicaCore&
DescriptorUpdateQueue& update_queue_, u32 image_count)
: RasterizerAccelerated{memory, pica}, instance{instance}, scheduler{scheduler},
renderpass_cache{renderpass_cache}, update_queue{update_queue_},
pipeline_cache{instance, scheduler, renderpass_cache, update_queue}, runtime{instance,
scheduler,
renderpass_cache,
update_queue,
image_count},
pipeline_cache{instance, scheduler, renderpass_cache, update_queue},
runtime{instance, scheduler, renderpass_cache, update_queue, image_count},
res_cache{memory, custom_tex_manager, runtime, regs, renderer},
stream_buffer{instance, scheduler, BUFFER_USAGE, STREAM_BUFFER_SIZE},
uniform_buffer{instance, scheduler, vk::BufferUsageFlagBits::eUniformBuffer,
@@ -966,10 +963,9 @@ void RasterizerVulkan::SyncAndUploadLUTsLF() {
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
std::array<Common::Vec2f, 128> new_data;
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
[](const auto& entry) {
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()};
});
std::transform(
pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
[](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
if (new_data != fog_lut_data || invalidate) {
fog_lut_data = new_data;

View File

@@ -1450,8 +1450,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
Surface* color, Surface* depth)
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale
: (depth ? depth->res_scale : 1u)} {
: VideoCore::FramebufferParams{params},
res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
auto& renderpass_cache = runtime.GetRenderpassCache();
if (shadow_rendering && !color) {
return;
@@ -1544,8 +1544,8 @@ Sampler::Sampler(TextureRuntime& runtime, const VideoCore::SamplerParams& params
Sampler::~Sampler() = default;
DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string_view label)
: scheduler{runtime.GetScheduler()}, has_debug_tool{
runtime.GetInstance().HasDebuggingToolAttached()} {
: scheduler{runtime.GetScheduler()},
has_debug_tool{runtime.GetInstance().HasDebuggingToolAttached()} {
if (!has_debug_tool) {
return;
}