summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-12-17 01:30:55 -0800
committerGravatar Yuri Kunde Schlesner2017-01-25 18:53:24 -0800
commitade7ed7c5fd383e77c4d6949e652e1fd83844233 (patch)
treed356114242bafede2832a8ae8521da64321ac827 /src
parentDebugger: Always use interpreter for shader debugging (diff)
downloadyuzu-ade7ed7c5fd383e77c4d6949e652e1fd83844233.tar.gz
yuzu-ade7ed7c5fd383e77c4d6949e652e1fd83844233.tar.xz
yuzu-ade7ed7c5fd383e77c4d6949e652e1fd83844233.zip
VideoCore/Shader: Move ProduceDebugInfo to InterpreterEngine
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.h1
-rw-r--r--src/video_core/shader/shader.h11
-rw-r--r--src/video_core/shader/shader_interpreter.h11
-rw-r--r--src/video_core/shader/shader_jit_x64.cpp5
-rw-r--r--src/video_core/shader/shader_jit_x64.h2
5 files changed, 11 insertions, 19 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h
index bedea0bed..3292573f3 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 @@
8#include <QTreeView> 8#include <QTreeView>
9#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" 9#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"
10#include "nihstro/parser_shbin.h" 10#include "nihstro/parser_shbin.h"
11#include "video_core/shader/debug_data.h"
11#include "video_core/shader/shader.h" 12#include "video_core/shader/shader.h"
12 13
13class QLabel; 14class QLabel;
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h
index 2afd1024f..9d2410487 100644
--- a/src/video_core/shader/shader.h
+++ b/src/video_core/shader/shader.h
@@ -14,7 +14,6 @@
14#include "common/vector_math.h" 14#include "common/vector_math.h"
15#include "video_core/pica.h" 15#include "video_core/pica.h"
16#include "video_core/pica_types.h" 16#include "video_core/pica_types.h"
17#include "video_core/shader/debug_data.h"
18 17
19using nihstro::RegisterType; 18using nihstro::RegisterType;
20using nihstro::SourceRegister; 19using nihstro::SourceRegister;
@@ -192,16 +191,6 @@ public:
192 * @param state Shader unit state, must be setup per shader and per shader unit 191 * @param state Shader unit state, must be setup per shader and per shader unit
193 */ 192 */
194 virtual void Run(UnitState& state, unsigned int entry_point) const = 0; 193 virtual void Run(UnitState& state, unsigned int entry_point) const = 0;
195
196 /**
197 * Produce debug information based on the given shader and input vertex
198 * @param input Input vertex into the shader
199 * @param num_attributes The number of vertex shader attributes
200 * @param config Configuration object for the shader pipeline
201 * @return Debug information for this shader with regards to the given vertex
202 */
203 virtual DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,
204 unsigned int entry_point) const = 0;
205}; 194};
206 195
207// TODO(yuriks): Remove and make it non-global state somewhere 196// TODO(yuriks): Remove and make it non-global state somewhere
diff --git a/src/video_core/shader/shader_interpreter.h b/src/video_core/shader/shader_interpreter.h
index 43c1ed5ea..c3691da70 100644
--- a/src/video_core/shader/shader_interpreter.h
+++ b/src/video_core/shader/shader_interpreter.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "video_core/shader/debug_data.h"
7#include "video_core/shader/shader.h" 8#include "video_core/shader/shader.h"
8 9
9namespace Pica { 10namespace Pica {
@@ -14,8 +15,16 @@ class InterpreterEngine final : public ShaderEngine {
14public: 15public:
15 void SetupBatch(const ShaderSetup* setup) override; 16 void SetupBatch(const ShaderSetup* setup) override;
16 void Run(UnitState& state, unsigned int entry_point) const override; 17 void Run(UnitState& state, unsigned int entry_point) const override;
18
19 /**
20 * Produce debug information based on the given shader and input vertex
21 * @param input Input vertex into the shader
22 * @param num_attributes The number of vertex shader attributes
23 * @param config Configuration object for the shader pipeline
24 * @return Debug information for this shader with regards to the given vertex
25 */
17 DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, 26 DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,
18 unsigned int entry_point) const override; 27 unsigned int entry_point) const;
19 28
20private: 29private:
21 const ShaderSetup* setup = nullptr; 30 const ShaderSetup* setup = nullptr;
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp
index fea79538a..6d83948e1 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 {
47 cached_shader->Run(*setup, state, entry_point); 47 cached_shader->Run(*setup, state, entry_point);
48} 48}
49 49
50DebugData<true> JitX64Engine::ProduceDebugInfo(const InputVertex& input, int num_attributes,
51 unsigned int entry_point) const {
52 UNIMPLEMENTED_MSG("Shader tracing/debugging is not supported by the JIT.");
53}
54
55} // namespace Shader 50} // namespace Shader
56} // namespace Pica 51} // namespace Pica
diff --git a/src/video_core/shader/shader_jit_x64.h b/src/video_core/shader/shader_jit_x64.h
index df18de2c2..b26044477 100644
--- a/src/video_core/shader/shader_jit_x64.h
+++ b/src/video_core/shader/shader_jit_x64.h
@@ -21,8 +21,6 @@ public:
21 21
22 void SetupBatch(const ShaderSetup* setup) override; 22 void SetupBatch(const ShaderSetup* setup) override;
23 void Run(UnitState& state, unsigned int entry_point) const override; 23 void Run(UnitState& state, unsigned int entry_point) const override;
24 DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,
25 unsigned int entry_point) const override;
26 24
27private: 25private:
28 const ShaderSetup* setup = nullptr; 26 const ShaderSetup* setup = nullptr;