summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/TextureCache.cpp
diff options
context:
space:
mode:
authormagumagu <magumagu9@gmail.com>2015-01-21 20:37:12 -0800
committermagumagu <magumagu9@gmail.com>2015-01-23 10:48:15 -0800
commit6659c15bedd4add4bd536394900e74ab6b7d6648 (patch)
treef18e4e4bd9d2371746f2f59adae0a0d9c1ea8cad /Source/Core/VideoBackends/OGL/TextureCache.cpp
parente7f2a04699c0e7e622028b4feba07fb6f46142bf (diff)
Remove EFB to RAM cache, and simplify code.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/TextureCache.cpp61
1 files changed, 27 insertions, 34 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 1f12d5c148..83c4af7a98 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -168,41 +168,38 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
FramebufferManager::ResolveAndGetDepthTarget(srcRect) :
FramebufferManager::ResolveAndGetRenderTarget(srcRect);
- if (type != TCET_EC_DYNAMIC || g_ActiveConfig.bCopyEFBToTexture)
- {
- FramebufferManager::SetFramebuffer(framebuffer);
+ FramebufferManager::SetFramebuffer(framebuffer);
- OpenGL_BindAttributelessVAO();
+ OpenGL_BindAttributelessVAO();
- glActiveTexture(GL_TEXTURE0+9);
- glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture);
+ glActiveTexture(GL_TEXTURE0+9);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture);
- glViewport(0, 0, config.width, config.height);
+ glViewport(0, 0, config.width, config.height);
- GLuint uniform_location;
- if (srcFormat == PEControl::Z24)
- {
- s_DepthMatrixProgram.Bind();
- if (s_DepthCbufid != cbufid)
- glUniform4fv(s_DepthMatrixUniform, 5, colmat);
- s_DepthCbufid = cbufid;
- uniform_location = s_DepthCopyPositionUniform;
- }
- else
- {
- s_ColorMatrixProgram.Bind();
- if (s_ColorCbufid != cbufid)
- glUniform4fv(s_ColorMatrixUniform, 7, colmat);
- s_ColorCbufid = cbufid;
- uniform_location = s_ColorCopyPositionUniform;
- }
+ GLuint uniform_location;
+ if (srcFormat == PEControl::Z24)
+ {
+ s_DepthMatrixProgram.Bind();
+ if (s_DepthCbufid != cbufid)
+ glUniform4fv(s_DepthMatrixUniform, 5, colmat);
+ s_DepthCbufid = cbufid;
+ uniform_location = s_DepthCopyPositionUniform;
+ }
+ else
+ {
+ s_ColorMatrixProgram.Bind();
+ if (s_ColorCbufid != cbufid)
+ glUniform4fv(s_ColorMatrixUniform, 7, colmat);
+ s_ColorCbufid = cbufid;
+ uniform_location = s_ColorCopyPositionUniform;
+ }
- TargetRectangle R = g_renderer->ConvertEFBRectangle(srcRect);
- glUniform4f(uniform_location, static_cast<float>(R.left), static_cast<float>(R.top),
- static_cast<float>(R.right), static_cast<float>(R.bottom));
+ TargetRectangle R = g_renderer->ConvertEFBRectangle(srcRect);
+ glUniform4f(uniform_location, static_cast<float>(R.left), static_cast<float>(R.top),
+ static_cast<float>(R.right), static_cast<float>(R.bottom));
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- }
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
if (false == g_ActiveConfig.bCopyEFBToTexture)
{
@@ -220,11 +217,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
size_in_bytes = (u32)encoded_size;
- // Mark texture entries in destination address range dynamic unless caching is enabled and the texture entry is up to date
- if (!g_ActiveConfig.bEFBCopyCacheEnable)
- TextureCache::MakeRangeDynamic(addr,encoded_size);
- else if (!TextureCache::Find(addr, new_hash))
- TextureCache::MakeRangeDynamic(addr,encoded_size);
+ TextureCache::MakeRangeDynamic(addr,encoded_size);
hash = new_hash;
}