summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/engine_upload.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-04-25 18:57:10 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-05-01 21:31:39 +0200
commite64c41efe88e8f88014fef912b06b71b3df17e85 (patch)
tree626793bd10db844237b8136154ea6b81fe72e4b1 /src/video_core/engines/engine_upload.cpp
parentFixes and Corrections to DMA Engine (diff)
downloadyuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar.gz
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar.bz2
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar.lz
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar.xz
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.tar.zst
yuzu-e64c41efe88e8f88014fef912b06b71b3df17e85.zip
Diffstat (limited to 'src/video_core/engines/engine_upload.cpp')
-rw-r--r--src/video_core/engines/engine_upload.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp
index 867457f25..f8aa4ff55 100644
--- a/src/video_core/engines/engine_upload.cpp
+++ b/src/video_core/engines/engine_upload.cpp
@@ -9,7 +9,7 @@
namespace Tegra::Engines::Upload {
-State::State(MemoryManager& memory_manager, Data& regs)
+State::State(MemoryManager& memory_manager, Registers& regs)
: memory_manager(memory_manager), regs(regs) {}
void State::ProcessExec(const bool is_linear) {
@@ -23,24 +23,25 @@ void State::ProcessData(const u32 data, const bool is_last_call) {
const u32 sub_copy_size = std::min(4U, copy_size - write_offset);
std::memcpy(&inner_buffer[write_offset], &data, sub_copy_size);
write_offset += sub_copy_size;
- if (is_last_call) {
- const GPUVAddr address{regs.dest.Address()};
- if (is_linear) {
- memory_manager.WriteBlock(address, inner_buffer.data(), copy_size);
- } else {
- UNIMPLEMENTED_IF(regs.dest.z != 0);
- UNIMPLEMENTED_IF(regs.dest.depth != 1);
- UNIMPLEMENTED_IF(regs.dest.BlockWidth() != 1);
- UNIMPLEMENTED_IF(regs.dest.BlockDepth() != 1);
- const std::size_t dst_size = Tegra::Texture::CalculateSize(
- true, 1, regs.dest.width, regs.dest.height, 1, regs.dest.BlockHeight(), 1);
- std::vector<u8> tmp_buffer(dst_size);
- memory_manager.ReadBlock(address, tmp_buffer.data(), dst_size);
- Tegra::Texture::SwizzleKepler(regs.dest.width, regs.dest.height, regs.dest.x,
- regs.dest.y, regs.dest.BlockHeight(), copy_size,
- inner_buffer.data(), tmp_buffer.data());
- memory_manager.WriteBlock(address, tmp_buffer.data(), dst_size);
- }
+ if (!is_last_call) {
+ return;
+ }
+ const GPUVAddr address{regs.dest.Address()};
+ if (is_linear) {
+ memory_manager.WriteBlock(address, inner_buffer.data(), copy_size);
+ } else {
+ UNIMPLEMENTED_IF(regs.dest.z != 0);
+ UNIMPLEMENTED_IF(regs.dest.depth != 1);
+ UNIMPLEMENTED_IF(regs.dest.BlockWidth() != 1);
+ UNIMPLEMENTED_IF(regs.dest.BlockDepth() != 1);
+ const std::size_t dst_size = Tegra::Texture::CalculateSize(
+ true, 1, regs.dest.width, regs.dest.height, 1, regs.dest.BlockHeight(), 1);
+ tmp_buffer.resize(dst_size);
+ memory_manager.ReadBlock(address, tmp_buffer.data(), dst_size);
+ Tegra::Texture::SwizzleKepler(regs.dest.width, regs.dest.height, regs.dest.x, regs.dest.y,
+ regs.dest.BlockHeight(), copy_size, inner_buffer.data(),
+ tmp_buffer.data());
+ memory_manager.WriteBlock(address, tmp_buffer.data(), dst_size);
}
}