From 2e7dc4cac9cd2b446220f034006e1d65dede471f Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Tue, 28 Aug 2018 11:20:39 -0400
Subject: [PATCH] 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.
---
 src/video_core/renderer_opengl/gl_shader_cache.cpp | 3 +--
 1 file changed, 1 insertion(+), 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 3c3d1d35ef..326a901baf 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 {
 /// Gets the address for the specified shader stage program
 static Tegra::GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) {
     auto& gpu = Core::System::GetInstance().GPU().Maxwell3D();
-
-    GLShader::ProgramCode program_code(GLShader::MAX_PROGRAM_CODE_LENGTH);
     auto& shader_config = gpu.regs.shader_config[static_cast<size_t>(program)];
+
     return gpu.regs.code_address.CodeAddress() + shader_config.offset;
 }