diff options
| author | 2022-01-31 18:08:21 -0700 | |
|---|---|---|
| committer | 2022-01-31 18:08:21 -0700 | |
| commit | 34dc1c8bc2fc7d837787a4e779f354b339b12799 (patch) | |
| tree | 5bbbdf9b9e67a8374c9b19cb2166d817abe60a9b /src/video_core/engines | |
| parent | Merge pull request #7791 from german77/wall_clock (diff) | |
| parent | Rasterizer: Refactor inlineToMemory. (diff) | |
| download | yuzu-34dc1c8bc2fc7d837787a4e779f354b339b12799.tar.gz yuzu-34dc1c8bc2fc7d837787a4e779f354b339b12799.tar.xz yuzu-34dc1c8bc2fc7d837787a4e779f354b339b12799.zip | |
Merge pull request #7805 from FernandoS27/rodrigo-failed-me
Inline2Memory: Flush before writing buffer.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/engine_upload.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/engines/engine_upload.h | 8 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.h | 7 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 3 |
7 files changed, 29 insertions, 2 deletions
diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp index 71d7e1473..351b110fe 100644 --- a/src/video_core/engines/engine_upload.cpp +++ b/src/video_core/engines/engine_upload.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "video_core/engines/engine_upload.h" | 8 | #include "video_core/engines/engine_upload.h" |
| 9 | #include "video_core/memory_manager.h" | 9 | #include "video_core/memory_manager.h" |
| 10 | #include "video_core/rasterizer_interface.h" | ||
| 10 | #include "video_core/textures/decoders.h" | 11 | #include "video_core/textures/decoders.h" |
| 11 | 12 | ||
| 12 | namespace Tegra::Engines::Upload { | 13 | namespace Tegra::Engines::Upload { |
| @@ -16,6 +17,10 @@ State::State(MemoryManager& memory_manager_, Registers& regs_) | |||
| 16 | 17 | ||
| 17 | State::~State() = default; | 18 | State::~State() = default; |
| 18 | 19 | ||
| 20 | void State::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { | ||
| 21 | rasterizer = rasterizer_; | ||
| 22 | } | ||
| 23 | |||
| 19 | void State::ProcessExec(const bool is_linear_) { | 24 | void State::ProcessExec(const bool is_linear_) { |
| 20 | write_offset = 0; | 25 | write_offset = 0; |
| 21 | copy_size = regs.line_length_in * regs.line_count; | 26 | copy_size = regs.line_length_in * regs.line_count; |
| @@ -32,7 +37,7 @@ void State::ProcessData(const u32 data, const bool is_last_call) { | |||
| 32 | } | 37 | } |
| 33 | const GPUVAddr address{regs.dest.Address()}; | 38 | const GPUVAddr address{regs.dest.Address()}; |
| 34 | if (is_linear) { | 39 | if (is_linear) { |
| 35 | memory_manager.WriteBlock(address, inner_buffer.data(), copy_size); | 40 | rasterizer->AccelerateInlineToMemory(address, copy_size, inner_buffer); |
| 36 | } else { | 41 | } else { |
| 37 | UNIMPLEMENTED_IF(regs.dest.z != 0); | 42 | UNIMPLEMENTED_IF(regs.dest.z != 0); |
| 38 | UNIMPLEMENTED_IF(regs.dest.depth != 1); | 43 | UNIMPLEMENTED_IF(regs.dest.depth != 1); |
diff --git a/src/video_core/engines/engine_upload.h b/src/video_core/engines/engine_upload.h index 1c7f1effa..c9c5ec8c3 100644 --- a/src/video_core/engines/engine_upload.h +++ b/src/video_core/engines/engine_upload.h | |||
| @@ -12,6 +12,10 @@ namespace Tegra { | |||
| 12 | class MemoryManager; | 12 | class MemoryManager; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | namespace VideoCore { | ||
| 16 | class RasterizerInterface; | ||
| 17 | } | ||
| 18 | |||
| 15 | namespace Tegra::Engines::Upload { | 19 | namespace Tegra::Engines::Upload { |
| 16 | 20 | ||
| 17 | struct Registers { | 21 | struct Registers { |
| @@ -60,6 +64,9 @@ public: | |||
| 60 | void ProcessExec(bool is_linear_); | 64 | void ProcessExec(bool is_linear_); |
| 61 | void ProcessData(u32 data, bool is_last_call); | 65 | void ProcessData(u32 data, bool is_last_call); |
| 62 | 66 | ||
| 67 | /// Binds a rasterizer to this engine. | ||
| 68 | void BindRasterizer(VideoCore::RasterizerInterface* rasterizer); | ||
| 69 | |||
| 63 | private: | 70 | private: |
| 64 | u32 write_offset = 0; | 71 | u32 write_offset = 0; |
| 65 | u32 copy_size = 0; | 72 | u32 copy_size = 0; |
| @@ -68,6 +75,7 @@ private: | |||
| 68 | bool is_linear = false; | 75 | bool is_linear = false; |
| 69 | Registers& regs; | 76 | Registers& regs; |
| 70 | MemoryManager& memory_manager; | 77 | MemoryManager& memory_manager; |
| 78 | VideoCore::RasterizerInterface* rasterizer = nullptr; | ||
| 71 | }; | 79 | }; |
| 72 | 80 | ||
| 73 | } // namespace Tegra::Engines::Upload | 81 | } // namespace Tegra::Engines::Upload |
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp index 492b4c5a3..5a1c12076 100644 --- a/src/video_core/engines/kepler_compute.cpp +++ b/src/video_core/engines/kepler_compute.cpp | |||
| @@ -22,6 +22,7 @@ KeplerCompute::~KeplerCompute() = default; | |||
| 22 | 22 | ||
| 23 | void KeplerCompute::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { | 23 | void KeplerCompute::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { |
| 24 | rasterizer = rasterizer_; | 24 | rasterizer = rasterizer_; |
| 25 | upload_state.BindRasterizer(rasterizer); | ||
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | void KeplerCompute::CallMethod(u32 method, u32 method_argument, bool is_last_call) { | 28 | void KeplerCompute::CallMethod(u32 method, u32 method_argument, bool is_last_call) { |
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index 560551157..8aed16caa 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp | |||
| @@ -19,6 +19,10 @@ KeplerMemory::KeplerMemory(Core::System& system_, MemoryManager& memory_manager) | |||
| 19 | 19 | ||
| 20 | KeplerMemory::~KeplerMemory() = default; | 20 | KeplerMemory::~KeplerMemory() = default; |
| 21 | 21 | ||
| 22 | void KeplerMemory::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { | ||
| 23 | upload_state.BindRasterizer(rasterizer_); | ||
| 24 | } | ||
| 25 | |||
| 22 | void KeplerMemory::CallMethod(u32 method, u32 method_argument, bool is_last_call) { | 26 | void KeplerMemory::CallMethod(u32 method, u32 method_argument, bool is_last_call) { |
| 23 | ASSERT_MSG(method < Regs::NUM_REGS, | 27 | ASSERT_MSG(method < Regs::NUM_REGS, |
| 24 | "Invalid KeplerMemory register, increase the size of the Regs structure"); | 28 | "Invalid KeplerMemory register, increase the size of the Regs structure"); |
diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.h index 0d8ea09a9..949e2fae1 100644 --- a/src/video_core/engines/kepler_memory.h +++ b/src/video_core/engines/kepler_memory.h | |||
| @@ -22,6 +22,10 @@ namespace Tegra { | |||
| 22 | class MemoryManager; | 22 | class MemoryManager; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | namespace VideoCore { | ||
| 26 | class RasterizerInterface; | ||
| 27 | } | ||
| 28 | |||
| 25 | namespace Tegra::Engines { | 29 | namespace Tegra::Engines { |
| 26 | 30 | ||
| 27 | /** | 31 | /** |
| @@ -38,6 +42,9 @@ public: | |||
| 38 | explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager); | 42 | explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager); |
| 39 | ~KeplerMemory() override; | 43 | ~KeplerMemory() override; |
| 40 | 44 | ||
| 45 | /// Binds a rasterizer to this engine. | ||
| 46 | void BindRasterizer(VideoCore::RasterizerInterface* rasterizer); | ||
| 47 | |||
| 41 | /// Write the value to the register identified by method. | 48 | /// Write the value to the register identified by method. |
| 42 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; | 49 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; |
| 43 | 50 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index c38ebd670..5d6d217bb 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -31,6 +31,7 @@ Maxwell3D::~Maxwell3D() = default; | |||
| 31 | 31 | ||
| 32 | void Maxwell3D::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { | 32 | void Maxwell3D::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { |
| 33 | rasterizer = rasterizer_; | 33 | rasterizer = rasterizer_; |
| 34 | upload_state.BindRasterizer(rasterizer_); | ||
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | void Maxwell3D::InitializeRegisterDefaults() { | 37 | void Maxwell3D::InitializeRegisterDefaults() { |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index f22342dfb..dc9df6c8b 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1557,7 +1557,8 @@ private: | |||
| 1557 | 1557 | ||
| 1558 | static constexpr u32 null_cb_data = 0xFFFFFFFF; | 1558 | static constexpr u32 null_cb_data = 0xFFFFFFFF; |
| 1559 | struct CBDataState { | 1559 | struct CBDataState { |
| 1560 | std::array<std::array<u32, 0x4000>, 16> buffer; | 1560 | static constexpr size_t inline_size = 0x4000; |
| 1561 | std::array<std::array<u32, inline_size>, 16> buffer; | ||
| 1561 | u32 current{null_cb_data}; | 1562 | u32 current{null_cb_data}; |
| 1562 | u32 id{null_cb_data}; | 1563 | u32 id{null_cb_data}; |
| 1563 | u32 start_pos{}; | 1564 | u32 start_pos{}; |