diff options
Diffstat (limited to 'src/video_core/shader/shader.cpp')
| -rw-r--r-- | src/video_core/shader/shader.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
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 | ||
| 123 | void ShaderSetup::Run(UnitState& state) { | 123 | void 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 | ||
| 142 | DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes, | 141 | DebugData<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 | ||