VERY experimental Nintendo Switch 2 emulator
C++
Clang Format and Documentation.
Fernando Sahmkow9f9e662f1f1a
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txtindex 8ede4ba9b8..4e86bc4f7d 100644--- a/src/video_core/CMakeLists.txt+++ b/src/video_core/CMakeLists.txt@@ -8,6 +8,7 @@ add_library(video_core STATICdma_pusher.hengines/const_buffer_engine_interface.hengines/const_buffer_info.h+ engines/engine_interface.hengines/engine_upload.cppengines/engine_upload.hengines/fermi_2d.cppdiff --git a/src/video_core/engines/engine_interface.h b/src/video_core/engines/engine_interface.hindex c8f20408de..18a9db7e6f 100644--- a/src/video_core/engines/engine_interface.h+++ b/src/video_core/engines/engine_interface.h@@ -15,7 +15,8 @@ public:virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0;/// Write multiple values to the register identified by method.- virtual void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) = 0;+ virtual void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) = 0;};-}+} // namespace Tegra::Enginesdiff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.hindex 77c2a0e398..8f37d053f8 100644--- a/src/video_core/engines/fermi_2d.h+++ b/src/video_core/engines/fermi_2d.h@@ -41,7 +41,8 @@ public:void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;/// Write multiple values to the register identified by method.- void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) override;+ void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) override;enum class Origin : u32 {Center = 0,diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cppindex 88717b431d..f6237fc6a2 100644--- a/src/video_core/engines/kepler_compute.cpp+++ b/src/video_core/engines/kepler_compute.cpp@@ -24,7 +24,7 @@ KeplerCompute::KeplerCompute(Core::System& system, VideoCore::RasterizerInterfacKeplerCompute::~KeplerCompute() = default;-void KeplerCompute::CallMethod(u32 method, u32 method_argument, bool is_last_call) {+void KeplerCompute::CallMethod(u32 method, u32 method_argument, bool is_last_call) {ASSERT_MSG(method < Regs::NUM_REGS,"Invalid KeplerCompute register, increase the size of the Regs structure");diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.hindex abeb41e84d..18ceedfaf5 100644--- a/src/video_core/engines/kepler_compute.h+++ b/src/video_core/engines/kepler_compute.h@@ -204,7 +204,8 @@ public:void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;/// Write multiple values to the register identified by method.- void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) override;+ void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) override;Texture::FullTextureInfo GetTexture(std::size_t offset) const;diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.hindex 193caf2066..5b7f71a00b 100644--- a/src/video_core/engines/kepler_memory.h+++ b/src/video_core/engines/kepler_memory.h@@ -42,7 +42,8 @@ public:void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;/// Write multiple values to the register identified by method.- void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) override;+ void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) override;struct Regs {static constexpr size_t NUM_REGS = 0x7F;diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.hindex 3d1e49c7cf..9d3f181fff 100644--- a/src/video_core/engines/maxwell_3d.h+++ b/src/video_core/engines/maxwell_3d.h@@ -1361,7 +1361,8 @@ public:void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;/// Write multiple values to the register identified by method.- void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) override;+ void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) override;/// Write the value to the register identified by method.void CallMethodFromMME(u32 method, u32 method_argument);diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.hindex 65739f2e3f..502dd85096 100644--- a/src/video_core/engines/maxwell_dma.h+++ b/src/video_core/engines/maxwell_dma.h@@ -37,7 +37,8 @@ public:void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;/// Write multiple values to the register identified by method.- void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) override;+ void CallMultiMethod(u32 method, const u32* base_start, u32 amount,+ u32 methods_pending) override;struct Regs {static constexpr std::size_t NUM_REGS = 0x1D6;diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cppindex f10d69fd5c..c4f33838ca 100644--- a/src/video_core/gpu.cpp+++ b/src/video_core/gpu.cpp@@ -305,13 +305,15 @@ void GPU::CallEngineMethod(const MethodCall& method_call) {maxwell_3d->CallMethod(method_call.method, method_call.argument, method_call.IsLastCall());break;case EngineID::KEPLER_COMPUTE_B:- kepler_compute->CallMethod(method_call.method, method_call.argument, method_call.IsLastCall());+ kepler_compute->CallMethod(method_call.method, method_call.argument,+ method_call.IsLastCall());break;case EngineID::MAXWELL_DMA_COPY_A:maxwell_dma->CallMethod(method_call.method, method_call.argument, method_call.IsLastCall());break;case EngineID::KEPLER_INLINE_TO_MEMORY_B:- kepler_memory->CallMethod(method_call.method, method_call.argument, method_call.IsLastCall());+ kepler_memory->CallMethod(method_call.method, method_call.argument,+ method_call.IsLastCall());break;default:UNIMPLEMENTED_MSG("Unimplemented engine");diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.hindex e0ff83754e..06f3ebf87b 100644--- a/src/video_core/textures/decoders.h+++ b/src/video_core/textures/decoders.h@@ -59,6 +59,7 @@ void UnswizzleSubrect(u32 subrect_width, u32 subrect_height, u32 dest_pitch, u32void SwizzleKepler(u32 width, u32 height, u32 dst_x, u32 dst_y, u32 block_height,std::size_t copy_size, const u8* source_data, u8* swizzle_data);+/// Obtains the offset of the gob for positions 'dst_x' & 'dst_y'u64 GetGOBOffset(u32 width, u32 height, u32 dst_x, u32 dst_y, u32 block_height,u32 bytes_per_pixel);