From 32c49173ad15c1262640b9e07b9104146278af2f Mon Sep 17 00:00:00 2001 From: Exverge Date: Sat, 6 Apr 2024 21:01:21 -0400 Subject: [PATCH] fix: clang format --- externals/metal-cpp/README.md | 2 +- src/suyu/bootmanager.cpp | 4 ++-- .../renderer_metal/mtl_buffer_cache.cpp | 6 +++--- .../renderer_metal/mtl_rasterizer.cpp | 20 +++++++++---------- .../renderer_metal/renderer_metal.cpp | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/externals/metal-cpp/README.md b/externals/metal-cpp/README.md index 52e1938cff..d8204d76cc 100644 --- a/externals/metal-cpp/README.md +++ b/externals/metal-cpp/README.md @@ -255,7 +255,7 @@ printf( "string = \"%s\"\n", [string cStringUsingEncoding: NSASCIIStringEncoding ```objc NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSString* string = [NSString stringWithCString: "Hello World" encoding: NSASCIIStringEncoding]; - + printf( "string = \"%s\"\n", [string cStringUsingEncoding: NSASCIIStringEncoding] ); [pool release]; diff --git a/src/suyu/bootmanager.cpp b/src/suyu/bootmanager.cpp index 023ece4868..fd2e757cbf 100644 --- a/src/suyu/bootmanager.cpp +++ b/src/suyu/bootmanager.cpp @@ -292,8 +292,8 @@ struct NullRenderWidget : public RenderWidget { GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, std::shared_ptr input_subsystem_, Core::System& system_) - : QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, - system{system_} { + : QWidget(parent), + emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} { setWindowTitle(QStringLiteral("suyu %1 | %2-%3") .arg(QString::fromUtf8(Common::g_build_name), QString::fromUtf8(Common::g_scm_branch), diff --git a/src/video_core/renderer_metal/mtl_buffer_cache.cpp b/src/video_core/renderer_metal/mtl_buffer_cache.cpp index 4ed4af520d..1e0454c7d5 100644 --- a/src/video_core/renderer_metal/mtl_buffer_cache.cpp +++ b/src/video_core/renderer_metal/mtl_buffer_cache.cpp @@ -39,12 +39,12 @@ BufferView::~BufferView() { } Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_params) - : VideoCommon::BufferBase(null_params), buffer{runtime.CreateNullBuffer()}, is_null{true}, + : BufferBase(null_params), buffer{runtime.CreateNullBuffer()}, is_null{true}, view(buffer, 0, BufferCacheRuntime::NULL_BUFFER_SIZE) {} Buffer::Buffer(BufferCacheRuntime& runtime, DAddr cpu_addr_, u64 size_bytes_) - : VideoCommon::BufferBase(cpu_addr_, size_bytes_), - buffer{CreatePrivateBuffer(runtime.device, size_bytes_)}, view(buffer, 0, size_bytes_) {} + : BufferBase(cpu_addr_, size_bytes_), buffer{CreatePrivateBuffer(runtime.device, size_bytes_)}, + view(buffer, 0, size_bytes_) {} BufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format) { return BufferView(buffer, offset, size, format); diff --git a/src/video_core/renderer_metal/mtl_rasterizer.cpp b/src/video_core/renderer_metal/mtl_rasterizer.cpp index a49eda8c0f..b8995138ca 100644 --- a/src/video_core/renderer_metal/mtl_rasterizer.cpp +++ b/src/video_core/renderer_metal/mtl_rasterizer.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" -#include "video_core/control/channel_state.h" -#include "video_core/host1x/host1x.h" -#include "video_core/memory_manager.h" #include "video_core/buffer_cache/buffer_cache.h" +#include "video_core/control/channel_state.h" #include "video_core/engines/draw_manager.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" +#include "video_core/host1x/host1x.h" +#include "video_core/memory_manager.h" #include "video_core/renderer_metal/mtl_command_recorder.h" #include "video_core/renderer_metal/mtl_device.h" #include "video_core/renderer_metal/mtl_rasterizer.h" @@ -40,8 +40,8 @@ RasterizerMetal::~RasterizerMetal() = default; void RasterizerMetal::Draw(bool is_indexed, u32 instance_count) { // TODO: uncomment - //command_recorder.CheckIfRenderPassIsActive(); - //const auto& draw_state = maxwell3d->draw_manager->GetDrawState(); + // command_recorder.CheckIfRenderPassIsActive(); + // const auto& draw_state = maxwell3d->draw_manager->GetDrawState(); if (is_indexed) { LOG_DEBUG(Render_Metal, "indexed"); /*[command_buffer drawIndexedPrimitives:MTLPrimitiveTypeTriangle @@ -52,13 +52,13 @@ void RasterizerMetal::Draw(bool is_indexed, u32 instance_count) { instanceCount:draw_params.num_instances baseVertex:draw_params.base_vertex baseInstance:draw_params.base_instance];*/ - //cmdbuf.DrawIndexed(draw_params.num_vertices, draw_params.num_instances, - // draw_params.first_index, draw_params.base_vertex, - // draw_params.base_instance); + // cmdbuf.DrawIndexed(draw_params.num_vertices, draw_params.num_instances, + // draw_params.first_index, draw_params.base_vertex, + // draw_params.base_instance); } else { LOG_DEBUG(Render_Metal, "not indexed"); - //cmdbuf.Draw(draw_params.num_vertices, draw_params.num_instances, - // draw_params.base_vertex, draw_params.base_instance); + // cmdbuf.Draw(draw_params.num_vertices, draw_params.num_instances, + // draw_params.base_vertex, draw_params.base_instance); } } diff --git a/src/video_core/renderer_metal/renderer_metal.cpp b/src/video_core/renderer_metal/renderer_metal.cpp index e9c6c11155..20b90945f3 100644 --- a/src/video_core/renderer_metal/renderer_metal.cpp +++ b/src/video_core/renderer_metal/renderer_metal.cpp @@ -12,8 +12,8 @@ namespace Metal { RendererMetal::RendererMetal(Core::Frontend::EmuWindow& emu_window, Tegra::MaxwellDeviceMemoryManager& device_memory_, Tegra::GPU& gpu_, std::unique_ptr context_) - : RendererBase(emu_window, std::move(context_)), device_memory{device_memory_}, gpu{gpu_}, - device{}, command_recorder(device), + : RendererBase(emu_window, std::move(context_)), + device_memory{device_memory_}, gpu{gpu_}, device{}, command_recorder(device), swap_chain(device, command_recorder, static_cast(render_window.GetWindowInfo().render_surface)), rasterizer(gpu_, device_memory, device, command_recorder, swap_chain) {}