diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-12 03:37:47 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-12 03:37:47 +0200 |
commit | 996f14f75794f88fc7e3fb61bd4c07c744450977 (patch) | |
tree | 5a2da227058d4f22b3e3e0d21a1f13a02f7e5e37 /src/video_core/shader/shader.cpp | |
parent | Merge pull request #1621 from JayFoxRox/w-buffer (diff) | |
parent | Turn ShaderSetup into struct (diff) | |
download | yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar.gz yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar.bz2 yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar.lz yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar.xz yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.tar.zst yuzu-996f14f75794f88fc7e3fb61bd4c07c744450977.zip |
Diffstat (limited to 'src/video_core/shader/shader.cpp')
-rw-r--r-- | src/video_core/shader/shader.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 65dcc9156..449fc703f 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -35,7 +35,13 @@ static std::unordered_map<u64, std::unique_ptr<JitShader>> shader_map; static const JitShader* jit_shader; #endif // ARCHITECTURE_x86_64 -void Setup() { +void ClearCache() { +#ifdef ARCHITECTURE_x86_64 + shader_map.clear(); +#endif // ARCHITECTURE_x86_64 +} + +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)) ^ @@ -54,18 +60,12 @@ void Setup() { #endif // ARCHITECTURE_x86_64 } -void Shutdown() { -#ifdef ARCHITECTURE_x86_64 - shader_map.clear(); -#endif // ARCHITECTURE_x86_64 -} - -MICROPROFILE_DEFINE(GPU_VertexShader, "GPU", "Vertex Shader", MP_RGB(50, 50, 240)); +MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240)); -OutputVertex Run(UnitState<false>& state, const InputVertex& input, int num_attributes) { +OutputVertex ShaderSetup::Run(UnitState<false>& state, const InputVertex& input, int num_attributes) { auto& config = g_state.regs.vs; - MICROPROFILE_SCOPE(GPU_VertexShader); + MICROPROFILE_SCOPE(GPU_Shader); state.program_counter = config.main_offset; state.debug.max_offset = 0; @@ -140,7 +140,7 @@ OutputVertex Run(UnitState<false>& state, const InputVertex& input, int num_attr return ret; } -DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const ShaderSetup& setup) { +DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const ShaderSetup& setup) { UnitState<true> state; state.program_counter = config.main_offset; |