summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/engines/maxwell_3d.cpp6
-rw-r--r--src/video_core/engines/maxwell_compute.cpp6
-rw-r--r--src/video_core/engines/maxwell_dma.cpp17
3 files changed, 10 insertions, 19 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 8afd26fe9..bca014a4a 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -13,8 +13,7 @@
13#include "video_core/renderer_base.h" 13#include "video_core/renderer_base.h"
14#include "video_core/textures/texture.h" 14#include "video_core/textures/texture.h"
15 15
16namespace Tegra { 16namespace Tegra::Engines {
17namespace Engines {
18 17
19/// First register id that is actually a Macro call. 18/// First register id that is actually a Macro call.
20constexpr u32 MacroRegistersStart = 0xE00; 19constexpr u32 MacroRegistersStart = 0xE00;
@@ -408,5 +407,4 @@ void Maxwell3D::ProcessClearBuffers() {
408 rasterizer.Clear(); 407 rasterizer.Clear();
409} 408}
410 409
411} // namespace Engines 410} // namespace Tegra::Engines
412} // namespace Tegra
diff --git a/src/video_core/engines/maxwell_compute.cpp b/src/video_core/engines/maxwell_compute.cpp
index 59e28b22d..8b5f08351 100644
--- a/src/video_core/engines/maxwell_compute.cpp
+++ b/src/video_core/engines/maxwell_compute.cpp
@@ -6,8 +6,7 @@
6#include "core/core.h" 6#include "core/core.h"
7#include "video_core/engines/maxwell_compute.h" 7#include "video_core/engines/maxwell_compute.h"
8 8
9namespace Tegra { 9namespace Tegra::Engines {
10namespace Engines {
11 10
12void MaxwellCompute::WriteReg(u32 method, u32 value) { 11void MaxwellCompute::WriteReg(u32 method, u32 value) {
13 ASSERT_MSG(method < Regs::NUM_REGS, 12 ASSERT_MSG(method < Regs::NUM_REGS,
@@ -26,5 +25,4 @@ void MaxwellCompute::WriteReg(u32 method, u32 value) {
26 } 25 }
27} 26}
28 27
29} // namespace Engines 28} // namespace Tegra::Engines
30} // namespace Tegra
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp
index 103cd110e..b8a78cf82 100644
--- a/src/video_core/engines/maxwell_dma.cpp
+++ b/src/video_core/engines/maxwell_dma.cpp
@@ -7,8 +7,7 @@
7#include "video_core/rasterizer_interface.h" 7#include "video_core/rasterizer_interface.h"
8#include "video_core/textures/decoders.h" 8#include "video_core/textures/decoders.h"
9 9
10namespace Tegra { 10namespace Tegra::Engines {
11namespace Engines {
12 11
13MaxwellDMA::MaxwellDMA(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager) 12MaxwellDMA::MaxwellDMA(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager)
14 : memory_manager(memory_manager), rasterizer{rasterizer} {} 13 : memory_manager(memory_manager), rasterizer{rasterizer} {}
@@ -78,9 +77,9 @@ void MaxwellDMA::HandleCopy() {
78 77
79 ASSERT(regs.exec.enable_2d == 1); 78 ASSERT(regs.exec.enable_2d == 1);
80 79
81 std::size_t copy_size = regs.x_count * regs.y_count; 80 const std::size_t copy_size = regs.x_count * regs.y_count;
82 81
83 const auto FlushAndInvalidate = [&](u32 src_size, u32 dst_size) { 82 const auto FlushAndInvalidate = [&](u32 src_size, u64 dst_size) {
84 // TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated 83 // TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated
85 // copying. 84 // copying.
86 rasterizer.FlushRegion(source_cpu, src_size); 85 rasterizer.FlushRegion(source_cpu, src_size);
@@ -91,14 +90,11 @@ void MaxwellDMA::HandleCopy() {
91 rasterizer.InvalidateRegion(dest_cpu, dst_size); 90 rasterizer.InvalidateRegion(dest_cpu, dst_size);
92 }; 91 };
93 92
94 u8* src_buffer = Memory::GetPointer(source_cpu);
95 u8* dst_buffer = Memory::GetPointer(dest_cpu);
96
97 if (regs.exec.is_dst_linear && !regs.exec.is_src_linear) { 93 if (regs.exec.is_dst_linear && !regs.exec.is_src_linear) {
98 ASSERT(regs.src_params.size_z == 1); 94 ASSERT(regs.src_params.size_z == 1);
99 // If the input is tiled and the output is linear, deswizzle the input and copy it over. 95 // If the input is tiled and the output is linear, deswizzle the input and copy it over.
100 96
101 u32 src_bytes_per_pixel = regs.src_pitch / regs.src_params.size_x; 97 const u32 src_bytes_per_pixel = regs.src_pitch / regs.src_params.size_x;
102 98
103 FlushAndInvalidate(regs.src_pitch * regs.src_params.size_y, 99 FlushAndInvalidate(regs.src_pitch * regs.src_params.size_y,
104 copy_size * src_bytes_per_pixel); 100 copy_size * src_bytes_per_pixel);
@@ -111,7 +107,7 @@ void MaxwellDMA::HandleCopy() {
111 ASSERT(regs.dst_params.size_z == 1); 107 ASSERT(regs.dst_params.size_z == 1);
112 ASSERT(regs.src_pitch == regs.x_count); 108 ASSERT(regs.src_pitch == regs.x_count);
113 109
114 u32 src_bpp = regs.src_pitch / regs.x_count; 110 const u32 src_bpp = regs.src_pitch / regs.x_count;
115 111
116 FlushAndInvalidate(regs.src_pitch * regs.y_count, 112 FlushAndInvalidate(regs.src_pitch * regs.y_count,
117 regs.dst_params.size_x * regs.dst_params.size_y * src_bpp); 113 regs.dst_params.size_x * regs.dst_params.size_y * src_bpp);
@@ -122,5 +118,4 @@ void MaxwellDMA::HandleCopy() {
122 } 118 }
123} 119}
124 120
125} // namespace Engines 121} // namespace Tegra::Engines
126} // namespace Tegra