summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp2
-rw-r--r--src/video_core/debug_utils/debug_utils.h2
-rw-r--r--src/video_core/engines/maxwell_3d.cpp24
3 files changed, 13 insertions, 15 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 73fd4d7a3..22d44aab2 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -23,8 +23,6 @@
23 23
24namespace Tegra { 24namespace Tegra {
25 25
26std::shared_ptr<DebugContext> g_debug_context;
27
28void DebugContext::DoOnEvent(Event event, void* data) { 26void DebugContext::DoOnEvent(Event event, void* data) {
29 { 27 {
30 std::unique_lock<std::mutex> lock(breakpoint_mutex); 28 std::unique_lock<std::mutex> lock(breakpoint_mutex);
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 98461d6d9..bbba8e380 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -160,6 +160,4 @@ private:
160 std::list<BreakPointObserver*> breakpoint_observers; 160 std::list<BreakPointObserver*> breakpoint_observers;
161}; 161};
162 162
163extern std::shared_ptr<DebugContext> g_debug_context;
164
165} // namespace Tegra 163} // namespace Tegra
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index c962887ca..986165c6d 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -4,6 +4,7 @@
4 4
5#include <cinttypes> 5#include <cinttypes>
6#include "common/assert.h" 6#include "common/assert.h"
7#include "core/core.h"
7#include "video_core/debug_utils/debug_utils.h" 8#include "video_core/debug_utils/debug_utils.h"
8#include "video_core/engines/maxwell_3d.h" 9#include "video_core/engines/maxwell_3d.h"
9#include "video_core/textures/decoders.h" 10#include "video_core/textures/decoders.h"
@@ -50,6 +51,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
50 ASSERT_MSG(method < Regs::NUM_REGS, 51 ASSERT_MSG(method < Regs::NUM_REGS,
51 "Invalid Maxwell3D register, increase the size of the Regs structure"); 52 "Invalid Maxwell3D register, increase the size of the Regs structure");
52 53
54 auto debug_context = Core::System::GetInstance().GetGPUDebugContext();
55
53 // It is an error to write to a register other than the current macro's ARG register before it 56 // It is an error to write to a register other than the current macro's ARG register before it
54 // has finished execution. 57 // has finished execution.
55 if (executing_macro != 0) { 58 if (executing_macro != 0) {
@@ -76,8 +79,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
76 return; 79 return;
77 } 80 }
78 81
79 if (Tegra::g_debug_context) { 82 if (debug_context) {
80 Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandLoaded, nullptr); 83 debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandLoaded, nullptr);
81 } 84 }
82 85
83 regs.reg_array[method] = value; 86 regs.reg_array[method] = value;
@@ -146,9 +149,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
146 149
147#undef MAXWELL3D_REG_INDEX 150#undef MAXWELL3D_REG_INDEX
148 151
149 if (Tegra::g_debug_context) { 152 if (debug_context) {
150 Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed, 153 debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed, nullptr);
151 nullptr);
152 } 154 }
153} 155}
154 156
@@ -173,14 +175,14 @@ void Maxwell3D::ProcessQueryGet() {
173 175
174void Maxwell3D::DrawArrays() { 176void Maxwell3D::DrawArrays() {
175 LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring"); 177 LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring");
176 if (Tegra::g_debug_context) { 178 auto debug_context = Core::System::GetInstance().GetGPUDebugContext();
177 Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::IncomingPrimitiveBatch, 179
178 nullptr); 180 if (debug_context) {
181 debug_context->OnEvent(Tegra::DebugContext::Event::IncomingPrimitiveBatch, nullptr);
179 } 182 }
180 183
181 if (Tegra::g_debug_context) { 184 if (debug_context) {
182 Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::FinishedPrimitiveBatch, 185 debug_context->OnEvent(Tegra::DebugContext::Event::FinishedPrimitiveBatch, nullptr);
183 nullptr);
184 } 186 }
185} 187}
186 188