summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-04-22 19:27:36 -0400
committerGravatar Fernando Sahmkow2019-04-22 19:27:36 -0400
commit701ce1c9d03c6c6a70965cbba3e961ab06abf49c (patch)
treec7c50f939d9f79aa29900c62e8a42d224778c354 /src
parentIntroduce skeleton of the GPU Compute Engine. (diff)
downloadyuzu-701ce1c9d03c6c6a70965cbba3e961ab06abf49c.tar.gz
yuzu-701ce1c9d03c6c6a70965cbba3e961ab06abf49c.tar.xz
yuzu-701ce1c9d03c6c6a70965cbba3e961ab06abf49c.zip
Implement Maxwell3D Data Upload
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp16
-rw-r--r--src/video_core/engines/maxwell_3d.h19
2 files changed, 32 insertions, 3 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 9780417f2..78810dbbb 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -20,8 +20,8 @@ constexpr u32 MacroRegistersStart = 0xE00;
20 20
21Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer, 21Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer,
22 MemoryManager& memory_manager) 22 MemoryManager& memory_manager)
23 : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager}, macro_interpreter{ 23 : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager},
24 *this} { 24 macro_interpreter{*this}, upload_state{memory_manager, regs.upload} {
25 InitializeRegisterDefaults(); 25 InitializeRegisterDefaults();
26} 26}
27 27
@@ -253,6 +253,18 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
253 ProcessSyncPoint(); 253 ProcessSyncPoint();
254 break; 254 break;
255 } 255 }
256 case MAXWELL3D_REG_INDEX(exec_upload): {
257 upload_state.ProcessExec(regs.exec_upload.linear != 0);
258 break;
259 }
260 case MAXWELL3D_REG_INDEX(data_upload): {
261 bool is_last_call = method_call.IsLastCall();
262 upload_state.ProcessData(method_call.argument, is_last_call);
263 if (is_last_call) {
264 dirty_flags.OnMemoryWrite();
265 }
266 break;
267 }
256 default: 268 default:
257 break; 269 break;
258 } 270 }
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index cc2424d38..47fe1f137 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -14,6 +14,7 @@
14#include "common/common_funcs.h" 14#include "common/common_funcs.h"
15#include "common/common_types.h" 15#include "common/common_types.h"
16#include "common/math_util.h" 16#include "common/math_util.h"
17#include "video_core/engines/engine_upload.h"
17#include "video_core/gpu.h" 18#include "video_core/gpu.h"
18#include "video_core/macro_interpreter.h" 19#include "video_core/macro_interpreter.h"
19#include "video_core/textures/texture.h" 20#include "video_core/textures/texture.h"
@@ -579,7 +580,18 @@ public:
579 u32 bind; 580 u32 bind;
580 } macros; 581 } macros;
581 582
582 INSERT_PADDING_WORDS(0x69); 583 INSERT_PADDING_WORDS(0x17);
584
585 Upload::Data upload;
586 struct {
587 union {
588 BitField<0, 1, u32> linear;
589 };
590 } exec_upload;
591
592 u32 data_upload;
593
594 INSERT_PADDING_WORDS(0x44);
583 595
584 struct { 596 struct {
585 union { 597 union {
@@ -1175,6 +1187,8 @@ private:
1175 /// Interpreter for the macro codes uploaded to the GPU. 1187 /// Interpreter for the macro codes uploaded to the GPU.
1176 MacroInterpreter macro_interpreter; 1188 MacroInterpreter macro_interpreter;
1177 1189
1190 Upload::State upload_state;
1191
1178 /// Retrieves information about a specific TIC entry from the TIC buffer. 1192 /// Retrieves information about a specific TIC entry from the TIC buffer.
1179 Texture::TICEntry GetTICEntry(u32 tic_index) const; 1193 Texture::TICEntry GetTICEntry(u32 tic_index) const;
1180 1194
@@ -1218,6 +1232,9 @@ private:
1218 "Field " #field_name " has invalid position") 1232 "Field " #field_name " has invalid position")
1219 1233
1220ASSERT_REG_POSITION(macros, 0x45); 1234ASSERT_REG_POSITION(macros, 0x45);
1235ASSERT_REG_POSITION(upload, 0x60);
1236ASSERT_REG_POSITION(exec_upload, 0x6C);
1237ASSERT_REG_POSITION(data_upload, 0x6D);
1221ASSERT_REG_POSITION(sync_info, 0xB2); 1238ASSERT_REG_POSITION(sync_info, 0xB2);
1222ASSERT_REG_POSITION(tfb_enabled, 0x1D1); 1239ASSERT_REG_POSITION(tfb_enabled, 0x1D1);
1223ASSERT_REG_POSITION(rt, 0x200); 1240ASSERT_REG_POSITION(rt, 0x200);