diff options
| author | Markus Wick <markus+github@selfnet.de> | 2015-01-27 09:42:15 +0100 |
|---|---|---|
| committer | Markus Wick <markus+github@selfnet.de> | 2015-01-27 09:42:15 +0100 |
| commit | 43605f87166cc4bc5e76cec016076aeb6103e24f (patch) | |
| tree | c1e741a89e03fc6b4e0256c179f69b91829e76a4 /Source/Core/VideoBackends/OGL/TextureCache.cpp | |
| parent | 8eda3ca844ca9b05682ec57aa3be2cbe07e19d28 (diff) | |
| parent | 6659c15bedd4add4bd536394900e74ab6b7d6648 (diff) | |
Merge pull request #1948 from magumagu/remove-efb-cache
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.cpp | 61 |
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; } |
