summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-03-25 06:35:06 +0200
committerSubv <subv2112@gmail.com>2018-03-25 06:35:06 +0200
commit0ce52b1da2228f3325d94e52bead7335c8b07d1c (patch)
treedb027be43dcb9fecb99fc7f8e698d3affd7e28c2 /src/video_core
parentGPU: Added a function to retrieve the active textures for a shader stage. (diff)
downloadyuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar.gz
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar.bz2
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar.lz
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar.xz
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.tar.zst
yuzu-0ce52b1da2228f3325d94e52bead7335c8b07d1c.zip
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 @@
namespace Tegra {
-std::shared_ptr<DebugContext> g_debug_context;
-
void DebugContext::DoOnEvent(Event event, void* data) {
{
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:
std::list<BreakPointObserver*> breakpoint_observers;
};
-extern std::shared_ptr<DebugContext> g_debug_context;
-
} // 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 @@
#include <cinttypes>
#include "common/assert.h"
+#include "core/core.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/textures/decoders.h"
@@ -50,6 +51,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
ASSERT_MSG(method < Regs::NUM_REGS,
"Invalid Maxwell3D register, increase the size of the Regs structure");
+ auto debug_context = Core::System::GetInstance().GetGPUDebugContext();
+
// It is an error to write to a register other than the current macro's ARG register before it
// has finished execution.
if (executing_macro != 0) {
@@ -76,8 +79,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
return;
}
- if (Tegra::g_debug_context) {
- Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandLoaded, nullptr);
+ if (debug_context) {
+ debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandLoaded, nullptr);
}
regs.reg_array[method] = value;
@@ -146,9 +149,8 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
#undef MAXWELL3D_REG_INDEX
- if (Tegra::g_debug_context) {
- Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed,
- nullptr);
+ if (debug_context) {
+ debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed, nullptr);
}
}
@@ -173,14 +175,14 @@ void Maxwell3D::ProcessQueryGet() {
void Maxwell3D::DrawArrays() {
LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring");
- if (Tegra::g_debug_context) {
- Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::IncomingPrimitiveBatch,
- nullptr);
+ auto debug_context = Core::System::GetInstance().GetGPUDebugContext();
+
+ if (debug_context) {
+ debug_context->OnEvent(Tegra::DebugContext::Event::IncomingPrimitiveBatch, nullptr);
}
- if (Tegra::g_debug_context) {
- Tegra::g_debug_context->OnEvent(Tegra::DebugContext::Event::FinishedPrimitiveBatch,
- nullptr);
+ if (debug_context) {
+ debug_context->OnEvent(Tegra::DebugContext::Event::FinishedPrimitiveBatch, nullptr);
}
}