summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/TextureCache.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2014-11-04 00:53:14 +0100
committerJules Blok <jules.blok@gmail.com>2014-11-23 14:27:40 +0100
commitee76c03160b72731facbce135be26d7ef8cebba5 (patch)
treeb03e45c1fc917f3a53fcebdaccdb75bfd5ceb95b /Source/Core/VideoBackends/OGL/TextureCache.cpp
parent4d075c2efb4c1dda695cd8044b42cf7894b52e5a (diff)
TextureCache: Recompile EFB2Tex shaders when stereo 3D is toggled.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/TextureCache.cpp44
1 files changed, 27 insertions, 17 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 3c2661b043..547a527818 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -319,6 +319,32 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
TextureCache::TextureCache()
{
+ CompileShaders();
+
+ s_ActiveTexture = -1;
+ for (auto& gtex : s_Textures)
+ gtex = -1;
+}
+
+
+TextureCache::~TextureCache()
+{
+ DeleteShaders();
+}
+
+void TextureCache::DisableStage(unsigned int stage)
+{
+}
+
+void TextureCache::SetStage()
+{
+ // -1 is the initial value as we don't know which texture should be bound
+ if (s_ActiveTexture != (u32)-1)
+ glActiveTexture(GL_TEXTURE0 + s_ActiveTexture);
+}
+
+void TextureCache::CompileShaders()
+{
const char *pColorMatrixProg =
"SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n"
"uniform vec4 colmat[7];\n"
@@ -414,28 +440,12 @@ TextureCache::TextureCache()
s_ColorCopyPositionUniform = glGetUniformLocation(s_ColorMatrixProgram.glprogid, "copy_position");
s_DepthCopyPositionUniform = glGetUniformLocation(s_DepthMatrixProgram.glprogid, "copy_position");
-
- s_ActiveTexture = -1;
- for (auto& gtex : s_Textures)
- gtex = -1;
}
-
-TextureCache::~TextureCache()
+void TextureCache::DeleteShaders()
{
s_ColorMatrixProgram.Destroy();
s_DepthMatrixProgram.Destroy();
}
-void TextureCache::DisableStage(unsigned int stage)
-{
-}
-
-void TextureCache::SetStage ()
-{
- // -1 is the initial value as we don't know which texture should be bound
- if (s_ActiveTexture != (u32)-1)
- glActiveTexture(GL_TEXTURE0 + s_ActiveTexture);
-}
-
}