summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp3
-rw-r--r--src/video_core/shader/shader.cpp16
-rw-r--r--src/video_core/shader/shader.h3
3 files changed, 9 insertions, 13 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
index ff2e7e363..89512146e 100644
--- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
@@ -518,8 +518,7 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d
518 info.labels.insert({entry_point, "main"}); 518 info.labels.insert({entry_point, "main"});
519 519
520 // Generate debug information 520 // Generate debug information
521 debug_data = Pica::g_state.vs.ProduceDebugInfo(input_vertex, num_attributes, shader_config, 521 debug_data = shader_setup.ProduceDebugInfo(input_vertex, num_attributes, shader_config);
522 shader_setup);
523 522
524 // Reload widget state 523 // Reload widget state
525 for (int attr = 0; attr < num_attributes; ++attr) { 524 for (int attr = 0; attr < num_attributes; ++attr) {
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index 8dca9d0cb..868be1360 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -102,8 +102,8 @@ void ShaderSetup::Setup() {
102#ifdef ARCHITECTURE_x86_64 102#ifdef ARCHITECTURE_x86_64
103 if (VideoCore::g_shader_jit_enabled) { 103 if (VideoCore::g_shader_jit_enabled) {
104 u64 cache_key = 104 u64 cache_key =
105 Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^ 105 Common::ComputeHash64(&program_code, sizeof(program_code)) ^
106 Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data)); 106 Common::ComputeHash64(&swizzle_data, sizeof(swizzle_data));
107 107
108 auto iter = shader_map.find(cache_key); 108 auto iter = shader_map.find(cache_key);
109 if (iter != shader_map.end()) { 109 if (iter != shader_map.end()) {
@@ -122,33 +122,31 @@ MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240));
122 122
123void ShaderSetup::Run(UnitState& state) { 123void ShaderSetup::Run(UnitState& state) {
124 auto& config = g_state.regs.vs; 124 auto& config = g_state.regs.vs;
125 auto& setup = g_state.vs;
126 125
127 MICROPROFILE_SCOPE(GPU_Shader); 126 MICROPROFILE_SCOPE(GPU_Shader);
128 127
129#ifdef ARCHITECTURE_x86_64 128#ifdef ARCHITECTURE_x86_64
130 if (VideoCore::g_shader_jit_enabled) { 129 if (VideoCore::g_shader_jit_enabled) {
131 jit_shader->Run(setup, state, config.main_offset); 130 jit_shader->Run(*this, state, config.main_offset);
132 } else { 131 } else {
133 DebugData<false> dummy_debug_data; 132 DebugData<false> dummy_debug_data;
134 RunInterpreter(setup, state, dummy_debug_data, config.main_offset); 133 RunInterpreter(*this, state, dummy_debug_data, config.main_offset);
135 } 134 }
136#else 135#else
137 DebugData<false> dummy_debug_data; 136 DebugData<false> dummy_debug_data;
138 RunInterpreter(setup, state, dummy_debug_data, config.main_offset); 137 RunInterpreter(*this, state, dummy_debug_data, config.main_offset);
139#endif // ARCHITECTURE_x86_64 138#endif // ARCHITECTURE_x86_64
140} 139}
141 140
142DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes, 141DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes,
143 const Regs::ShaderConfig& config, 142 const Regs::ShaderConfig& config) {
144 const ShaderSetup& setup) {
145 UnitState state; 143 UnitState state;
146 DebugData<true> debug_data; 144 DebugData<true> debug_data;
147 145
148 // Setup input register table 146 // Setup input register table
149 boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero())); 147 boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero()));
150 state.LoadInputVertex(input, num_attributes); 148 state.LoadInputVertex(input, num_attributes);
151 RunInterpreter(setup, state, debug_data, config.main_offset); 149 RunInterpreter(*this, state, debug_data, config.main_offset);
152 return debug_data; 150 return debug_data;
153} 151}
154 152
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h
index c5d23e0ea..61becb6e5 100644
--- a/src/video_core/shader/shader.h
+++ b/src/video_core/shader/shader.h
@@ -198,11 +198,10 @@ struct ShaderSetup {
198 * @param input Input vertex into the shader 198 * @param input Input vertex into the shader
199 * @param num_attributes The number of vertex shader attributes 199 * @param num_attributes The number of vertex shader attributes
200 * @param config Configuration object for the shader pipeline 200 * @param config Configuration object for the shader pipeline
201 * @param setup Setup object for the shader pipeline
202 * @return Debug information for this shader with regards to the given vertex 201 * @return Debug information for this shader with regards to the given vertex
203 */ 202 */
204 DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, 203 DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,
205 const Regs::ShaderConfig& config, const ShaderSetup& setup); 204 const Regs::ShaderConfig& config);
206}; 205};
207 206
208} // namespace Shader 207} // namespace Shader