From e3caf669b05bc0727053885ee7e6e5c78d655df4 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 16 Dec 2016 21:48:36 -0800 Subject: VideoCore/Shader: Use self instead of g_state.vs in ShaderSetup --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/graphics') 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 info.labels.insert({entry_point, "main"}); // Generate debug information - debug_data = Pica::g_state.vs.ProduceDebugInfo(input_vertex, num_attributes, shader_config, - shader_setup); + debug_data = shader_setup.ProduceDebugInfo(input_vertex, num_attributes, shader_config); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3 From 1e1f9398176e4f1ec608f31f22a576c749a0a723 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 16 Dec 2016 22:30:00 -0800 Subject: VideoCore/Shader: Use only entry_point as ShaderSetup param This removes all implicit dependency of ShaderState on global PICA state. --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/graphics') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 89512146e..c556d3b15 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -518,7 +518,7 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d info.labels.insert({entry_point, "main"}); // Generate debug information - debug_data = shader_setup.ProduceDebugInfo(input_vertex, num_attributes, shader_config); + debug_data = shader_setup.ProduceDebugInfo(input_vertex, num_attributes, entry_point); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3 From dd4a1672a77830a53de61cf0554b34e9e17a2905 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 16 Dec 2016 23:21:26 -0800 Subject: VideoCore/Shader: Split shader uniform state and shader engine Currently there's only a single dummy implementation, which will be split in a following commit. --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/graphics') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index c556d3b15..7adc3ad14 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -518,7 +518,9 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d info.labels.insert({entry_point, "main"}); // Generate debug information - debug_data = shader_setup.ProduceDebugInfo(input_vertex, num_attributes, entry_point); + auto* shader_engine = Pica::Shader::GetEngine(); + shader_engine->SetupBatch(&shader_setup); + debug_data = shader_engine->ProduceDebugInfo(input_vertex, num_attributes, entry_point); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3 From a9b7752b9d834335410a9e14a99cb943d0850575 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 17 Dec 2016 01:26:07 -0800 Subject: Debugger: Always use interpreter for shader debugging --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/citra_qt/debugger/graphics') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 7adc3ad14..c6f807eb3 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -18,7 +18,9 @@ #include "citra_qt/util/util.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/shader/debug_data.h" #include "video_core/shader/shader.h" +#include "video_core/shader/shader_interpreter.h" using nihstro::OpCode; using nihstro::Instruction; @@ -518,9 +520,9 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d info.labels.insert({entry_point, "main"}); // Generate debug information - auto* shader_engine = Pica::Shader::GetEngine(); - shader_engine->SetupBatch(&shader_setup); - debug_data = shader_engine->ProduceDebugInfo(input_vertex, num_attributes, entry_point); + Pica::Shader::InterpreterEngine shader_engine; + shader_engine.SetupBatch(&shader_setup); + debug_data = shader_engine.ProduceDebugInfo(input_vertex, num_attributes, entry_point); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3 From ade7ed7c5fd383e77c4d6949e652e1fd83844233 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 17 Dec 2016 01:30:55 -0800 Subject: VideoCore/Shader: Move ProduceDebugInfo to InterpreterEngine --- src/citra_qt/debugger/graphics/graphics_vertex_shader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/citra_qt/debugger/graphics') 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 @@ #include #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; -- cgit v1.2.3 From 0f642741451e3f75c2f1d64ae9beccaf1437f12c Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 17 Dec 2016 16:06:04 -0800 Subject: VideoCore/Shader: Move per-batch ShaderEngine state into ShaderSetup --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/graphics') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index c6f807eb3..616b34d56 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -521,8 +521,9 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d // Generate debug information Pica::Shader::InterpreterEngine shader_engine; - shader_engine.SetupBatch(&shader_setup); - debug_data = shader_engine.ProduceDebugInfo(input_vertex, num_attributes, entry_point); + shader_engine.SetupBatch(shader_setup); + debug_data = + shader_engine.ProduceDebugInfo(shader_setup, input_vertex, num_attributes, entry_point); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3 From 0e9081b97348c65029c96697443acb0dbbc58756 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 17 Dec 2016 16:16:02 -0800 Subject: VideoCore/Shader: Move entry_point to SetupBatch --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/citra_qt/debugger/graphics') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 616b34d56..f37524190 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -521,9 +521,8 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d // Generate debug information Pica::Shader::InterpreterEngine shader_engine; - shader_engine.SetupBatch(shader_setup); - debug_data = - shader_engine.ProduceDebugInfo(shader_setup, input_vertex, num_attributes, entry_point); + shader_engine.SetupBatch(shader_setup, entry_point); + debug_data = shader_engine.ProduceDebugInfo(shader_setup, input_vertex, num_attributes); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { -- cgit v1.2.3