diff options
| author | 2018-03-04 19:13:15 -0500 | |
|---|---|---|
| committer | 2018-03-04 19:14:04 -0500 | |
| commit | 5fb4c718cc831c31fb1e049aa015df7576f7e0f8 (patch) | |
| tree | bd7fc5fd8f216f37e87524a17297db5f2ee7f19d /src | |
| parent | Merge pull request #229 from Subv/ensuresavedata_impl (diff) | |
| download | yuzu-5fb4c718cc831c31fb1e049aa015df7576f7e0f8.tar.gz yuzu-5fb4c718cc831c31fb1e049aa015df7576f7e0f8.tar.xz yuzu-5fb4c718cc831c31fb1e049aa015df7576f7e0f8.zip | |
GPU: Intercept writes to the VERTEX_END_GL register.
This is the register that gets written after a game calls DrawArrays().
We should collect all GPU state and draw using our graphics API here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 9f699399f..842c5a014 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -19,6 +19,10 @@ void Maxwell3D::WriteReg(u32 method, u32 value) { | |||
| 19 | #define MAXWELL3D_REG_INDEX(field_name) (offsetof(Regs, field_name) / sizeof(u32)) | 19 | #define MAXWELL3D_REG_INDEX(field_name) (offsetof(Regs, field_name) / sizeof(u32)) |
| 20 | 20 | ||
| 21 | switch (method) { | 21 | switch (method) { |
| 22 | case MAXWELL3D_REG_INDEX(draw.vertex_end_gl): { | ||
| 23 | DrawArrays(); | ||
| 24 | break; | ||
| 25 | } | ||
| 22 | case MAXWELL3D_REG_INDEX(query.query_get): { | 26 | case MAXWELL3D_REG_INDEX(query.query_get): { |
| 23 | ProcessQueryGet(); | 27 | ProcessQueryGet(); |
| 24 | break; | 28 | break; |
| @@ -47,5 +51,10 @@ void Maxwell3D::ProcessQueryGet() { | |||
| 47 | UNIMPLEMENTED_MSG("Query mode %u not implemented", regs.query.query_get.mode.Value()); | 51 | UNIMPLEMENTED_MSG("Query mode %u not implemented", regs.query.query_get.mode.Value()); |
| 48 | } | 52 | } |
| 49 | } | 53 | } |
| 54 | |||
| 55 | void Maxwell3D::DrawArrays() { | ||
| 56 | LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring"); | ||
| 57 | } | ||
| 58 | |||
| 50 | } // namespace Engines | 59 | } // namespace Engines |
| 51 | } // namespace Tegra | 60 | } // namespace Tegra |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 1eeef6857..93f7698a0 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -32,7 +32,12 @@ public: | |||
| 32 | 32 | ||
| 33 | union { | 33 | union { |
| 34 | struct { | 34 | struct { |
| 35 | INSERT_PADDING_WORDS(0x6C0); | 35 | INSERT_PADDING_WORDS(0x585); |
| 36 | struct { | ||
| 37 | u32 vertex_end_gl; | ||
| 38 | u32 vertex_begin_gl; | ||
| 39 | } draw; | ||
| 40 | INSERT_PADDING_WORDS(0x139); | ||
| 36 | struct { | 41 | struct { |
| 37 | u32 query_address_high; | 42 | u32 query_address_high; |
| 38 | u32 query_address_low; | 43 | u32 query_address_low; |
| @@ -61,6 +66,9 @@ private: | |||
| 61 | /// Handles a write to the QUERY_GET register. | 66 | /// Handles a write to the QUERY_GET register. |
| 62 | void ProcessQueryGet(); | 67 | void ProcessQueryGet(); |
| 63 | 68 | ||
| 69 | /// Handles a write to the VERTEX_END_GL register, triggering a draw. | ||
| 70 | void DrawArrays(); | ||
| 71 | |||
| 64 | MemoryManager& memory_manager; | 72 | MemoryManager& memory_manager; |
| 65 | }; | 73 | }; |
| 66 | 74 | ||