summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-28 11:20:39 -0400
committerGravatar Lioncash2018-08-28 11:20:41 -0400
commit2e7dc4cac9cd2b446220f034006e1d65dede471f (patch)
tree4f5a70cf5e994e0b4746aac02e27eec8f1298a7b /src
parentMerge pull request #1165 from bunnei/shader-cache (diff)
downloadyuzu-2e7dc4cac9cd2b446220f034006e1d65dede471f.tar.gz
yuzu-2e7dc4cac9cd2b446220f034006e1d65dede471f.tar.xz
yuzu-2e7dc4cac9cd2b446220f034006e1d65dede471f.zip
gl_shader_cache: Remove unused program_code vector in GetShaderAddress()
Given std::vector is a type with a non-trivial destructor, this variable cannot be optimized away by the compiler, even if unused. Because of that, something that was intended to be fairly lightweight, was actually allocating 32KB and deallocating it at the end of the function.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 3c3d1d35e..326a901ba 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -14,9 +14,8 @@ namespace OpenGL {
14/// Gets the address for the specified shader stage program 14/// Gets the address for the specified shader stage program
15static Tegra::GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) { 15static Tegra::GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) {
16 auto& gpu = Core::System::GetInstance().GPU().Maxwell3D(); 16 auto& gpu = Core::System::GetInstance().GPU().Maxwell3D();
17
18 GLShader::ProgramCode program_code(GLShader::MAX_PROGRAM_CODE_LENGTH);
19 auto& shader_config = gpu.regs.shader_config[static_cast<size_t>(program)]; 17 auto& shader_config = gpu.regs.shader_config[static_cast<size_t>(program)];
18
20 return gpu.regs.code_address.CodeAddress() + shader_config.offset; 19 return gpu.regs.code_address.CodeAddress() + shader_config.offset;
21} 20}
22 21