summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-12-17 06:48:36 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-01-26 03:53:23 +0100
commite3caf669b05bc0727053885ee7e6e5c78d655df4 (patch)
treeb1a9ef206e1a27664f5f1600f3d45a34a077edb2 /src/video_core
parentVideoCore/Shader: Extract input vertex loading code into function (diff)
downloadyuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar.gz
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar.bz2
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar.lz
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar.xz
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.tar.zst
yuzu-e3caf669b05bc0727053885ee7e6e5c78d655df4.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/shader/shader.cpp16
-rw-r--r--src/video_core/shader/shader.h3
2 files changed, 8 insertions, 11 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() {
#ifdef ARCHITECTURE_x86_64
if (VideoCore::g_shader_jit_enabled) {
u64 cache_key =
- Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^
- Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data));
+ Common::ComputeHash64(&program_code, sizeof(program_code)) ^
+ Common::ComputeHash64(&swizzle_data, sizeof(swizzle_data));
auto iter = shader_map.find(cache_key);
if (iter != shader_map.end()) {
@@ -122,33 +122,31 @@ MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240));
void ShaderSetup::Run(UnitState& state) {
auto& config = g_state.regs.vs;
- auto& setup = g_state.vs;
MICROPROFILE_SCOPE(GPU_Shader);
#ifdef ARCHITECTURE_x86_64
if (VideoCore::g_shader_jit_enabled) {
- jit_shader->Run(setup, state, config.main_offset);
+ jit_shader->Run(*this, state, config.main_offset);
} else {
DebugData<false> dummy_debug_data;
- RunInterpreter(setup, state, dummy_debug_data, config.main_offset);
+ RunInterpreter(*this, state, dummy_debug_data, config.main_offset);
}
#else
DebugData<false> dummy_debug_data;
- RunInterpreter(setup, state, dummy_debug_data, config.main_offset);
+ RunInterpreter(*this, state, dummy_debug_data, config.main_offset);
#endif // ARCHITECTURE_x86_64
}
DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes,
- const Regs::ShaderConfig& config,
- const ShaderSetup& setup) {
+ const Regs::ShaderConfig& config) {
UnitState state;
DebugData<true> debug_data;
// Setup input register table
boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero()));
state.LoadInputVertex(input, num_attributes);
- RunInterpreter(setup, state, debug_data, config.main_offset);
+ RunInterpreter(*this, state, debug_data, config.main_offset);
return debug_data;
}
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 {
* @param input Input vertex into the shader
* @param num_attributes The number of vertex shader attributes
* @param config Configuration object for the shader pipeline
- * @param setup Setup object for the shader pipeline
* @return Debug information for this shader with regards to the given vertex
*/
DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes,
- const Regs::ShaderConfig& config, const ShaderSetup& setup);
+ const Regs::ShaderConfig& config);
};
} // namespace Shader