summaryrefslogtreecommitdiff
path: root/src/video_core/shader/shader.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-12-16 22:30:00 -0800
committerGravatar Yuri Kunde Schlesner2017-01-25 18:53:23 -0800
commit1e1f9398176e4f1ec608f31f22a576c749a0a723 (patch)
tree1c2ced663dcfe434ae0750f0ca64590c1f1dba5f /src/video_core/shader/shader.cpp
parentVideoCore/Shader: Use self instead of g_state.vs in ShaderSetup (diff)
downloadyuzu-1e1f9398176e4f1ec608f31f22a576c749a0a723.tar.gz
yuzu-1e1f9398176e4f1ec608f31f22a576c749a0a723.tar.xz
yuzu-1e1f9398176e4f1ec608f31f22a576c749a0a723.zip
VideoCore/Shader: Use only entry_point as ShaderSetup param
This removes all implicit dependency of ShaderState on global PICA state.
Diffstat (limited to 'src/video_core/shader/shader.cpp')
-rw-r--r--src/video_core/shader/shader.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index 868be1360..936db0582 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -120,33 +120,35 @@ void ShaderSetup::Setup() {
120 120
121MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240)); 121MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240));
122 122
123void ShaderSetup::Run(UnitState& state) { 123void ShaderSetup::Run(UnitState& state, unsigned int entry_point) {
124 auto& config = g_state.regs.vs; 124 ASSERT(entry_point < 1024);
125 125
126 MICROPROFILE_SCOPE(GPU_Shader); 126 MICROPROFILE_SCOPE(GPU_Shader);
127 127
128#ifdef ARCHITECTURE_x86_64 128#ifdef ARCHITECTURE_x86_64
129 if (VideoCore::g_shader_jit_enabled) { 129 if (VideoCore::g_shader_jit_enabled) {
130 jit_shader->Run(*this, state, config.main_offset); 130 jit_shader->Run(*this, state, entry_point);
131 } else { 131 } else {
132 DebugData<false> dummy_debug_data; 132 DebugData<false> dummy_debug_data;
133 RunInterpreter(*this, state, dummy_debug_data, config.main_offset); 133 RunInterpreter(*this, state, dummy_debug_data, entry_point);
134 } 134 }
135#else 135#else
136 DebugData<false> dummy_debug_data; 136 DebugData<false> dummy_debug_data;
137 RunInterpreter(*this, state, dummy_debug_data, config.main_offset); 137 RunInterpreter(*this, state, dummy_debug_data, entry_point);
138#endif // ARCHITECTURE_x86_64 138#endif // ARCHITECTURE_x86_64
139} 139}
140 140
141DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes, 141DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes,
142 const Regs::ShaderConfig& config) { 142 unsigned int entry_point) {
143 ASSERT(entry_point < 1024);
144
143 UnitState state; 145 UnitState state;
144 DebugData<true> debug_data; 146 DebugData<true> debug_data;
145 147
146 // Setup input register table 148 // Setup input register table
147 boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero())); 149 boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero()));
148 state.LoadInputVertex(input, num_attributes); 150 state.LoadInputVertex(input, num_attributes);
149 RunInterpreter(*this, state, debug_data, config.main_offset); 151 RunInterpreter(*this, state, debug_data, entry_point);
150 return debug_data; 152 return debug_data;
151} 153}
152 154