VERY experimental Nintendo Switch 2 emulator
C++
VideoCore/Shader: Move ProduceDebugInfo to InterpreterEngine
Yuri Kunde Schlesner46fc50931f93
diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.hindex bedea0bed2..3292573f3b 100644--- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h+++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h@@ -8,6 +8,7 @@#include <QTreeView>#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"#include "nihstro/parser_shbin.h"+#include "video_core/shader/debug_data.h"#include "video_core/shader/shader.h"class QLabel;diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.hindex 2afd1024fe..9d24104876 100644--- a/src/video_core/shader/shader.h+++ b/src/video_core/shader/shader.h@@ -14,7 +14,6 @@#include "common/vector_math.h"#include "video_core/pica.h"#include "video_core/pica_types.h"-#include "video_core/shader/debug_data.h"using nihstro::RegisterType;using nihstro::SourceRegister;@@ -192,16 +191,6 @@ public:* @param state Shader unit state, must be setup per shader and per shader unit*/virtual void Run(UnitState& state, unsigned int entry_point) const = 0;-- /**- * Produce debug information based on the given shader and input vertex- * @param input Input vertex into the shader- * @param num_attributes The number of vertex shader attributes- * @param config Configuration object for the shader pipeline- * @return Debug information for this shader with regards to the given vertex- */- virtual DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,- unsigned int entry_point) const = 0;};// TODO(yuriks): Remove and make it non-global state somewherediff --git a/src/video_core/shader/shader_interpreter.h b/src/video_core/shader/shader_interpreter.hindex 43c1ed5ea8..c3691da700 100644--- a/src/video_core/shader/shader_interpreter.h+++ b/src/video_core/shader/shader_interpreter.h@@ -4,6 +4,7 @@#pragma once+#include "video_core/shader/debug_data.h"#include "video_core/shader/shader.h"namespace Pica {@@ -14,8 +15,16 @@ class InterpreterEngine final : public ShaderEngine {public:void SetupBatch(const ShaderSetup* setup) override;void Run(UnitState& state, unsigned int entry_point) const override;++ /**+ * Produce debug information based on the given shader and input vertex+ * @param input Input vertex into the shader+ * @param num_attributes The number of vertex shader attributes+ * @param config Configuration object for the shader pipeline+ * @return Debug information for this shader with regards to the given vertex+ */DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,- unsigned int entry_point) const override;+ unsigned int entry_point) const;private:const ShaderSetup* setup = nullptr;diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cppindex fea79538a5..6d83948e18 100644--- a/src/video_core/shader/shader_jit_x64.cpp+++ b/src/video_core/shader/shader_jit_x64.cpp@@ -47,10 +47,5 @@ void JitX64Engine::Run(UnitState& state, unsigned int entry_point) const {cached_shader->Run(*setup, state, entry_point);}-DebugData<true> JitX64Engine::ProduceDebugInfo(const InputVertex& input, int num_attributes,- unsigned int entry_point) const {- UNIMPLEMENTED_MSG("Shader tracing/debugging is not supported by the JIT.");-}-} // namespace Shader} // namespace Picadiff --git a/src/video_core/shader/shader_jit_x64.h b/src/video_core/shader/shader_jit_x64.hindex df18de2c24..b260444774 100644--- a/src/video_core/shader/shader_jit_x64.h+++ b/src/video_core/shader/shader_jit_x64.h@@ -21,8 +21,6 @@ public:void SetupBatch(const ShaderSetup* setup) override;void Run(UnitState& state, unsigned int entry_point) const override;- DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,- unsigned int entry_point) const override;private:const ShaderSetup* setup = nullptr;