From c5008fe9dea7baf3368e214fe70e148d3bcca83b Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 26 Dec 2011 17:35:27 +0100 Subject: TextureCache: Renaming some variables OGL: Fix a possible bug at texture dumping OGL: Add a TODO about a possible bug --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index 39018c83bc..b1a5398d7d 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -107,7 +107,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo g_renderer->ResetAPIState(); // stretch picture with increased internal resolution - const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)virtualW, (float)virtualH); + const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)virtual_width, (float)virtual_height); D3D::context->RSSetViewports(1, &vp); // set transformation -- cgit v1.2.3 From 3b38295cbd08c98e7654e8715a88f4456cd61de5 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Tue, 27 Dec 2011 00:05:26 +0100 Subject: TextureCacheBase: De-uglify hybrid EFB copies (documentation needs updating though) TextureCacheBase: Fixed dynamic EFB copies being set to normal textures. --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index b1a5398d7d..05f0fa8629 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -102,7 +102,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) { - if (!isDynamic || g_ActiveConfig.bCopyEFBToTexture) + if (efbcopy_state != EC_VRAM_DYNAMIC || g_ActiveConfig.bCopyEFBToTexture) { g_renderer->ResetAPIState(); -- cgit v1.2.3 From cc54ee7d946da000b635beae03d998543a02d71d Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Fri, 30 Dec 2011 01:00:34 +0100 Subject: TextureCache: Move EFB copy cache code from TextureConverter to TextureCache --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index 05f0fa8629..ce9bee771e 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -149,17 +149,15 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo if (!g_ActiveConfig.bCopyEFBToTexture) { u8* dst = Memory::GetPointer(dstAddr); - size_t encodeSize = g_encoder->Encode(dst, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf); - hash = GetHash64(dst, encodeSize, g_ActiveConfig.iSafeTextureCache_ColorSamples); - if (g_ActiveConfig.bEFBCopyCacheEnable) - { - // If the texture in RAM is already in the texture cache, - // do not copy it again as it has not changed. - if (TextureCache::Find(dstAddr, hash)) - return; - } + size_t encoded_size = g_encoder->Encode(dst, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf); + + hash = GetHash64(dst, (int)encoded_size, g_ActiveConfig.iSafeTextureCache_ColorSamples); - TextureCache::MakeRangeDynamic(dstAddr, encodeSize); + // 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, (u32)encoded_size); + else if (!TextureCache::Find(addr, hash)) + TextureCache::MakeRangeDynamic(addr, (u32)encoded_size); } } -- cgit v1.2.3 From 1446fb33d515fc300c33afd535b22f441544b86e Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sun, 29 Jan 2012 20:24:23 +0100 Subject: TextureCacheBase: Replace the efbcopy_state member variable of texture cache entries with a more general "texture type" --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index ce9bee771e..e59fbd496e 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -102,7 +102,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) { - if (efbcopy_state != EC_VRAM_DYNAMIC || g_ActiveConfig.bCopyEFBToTexture) + if (type != TCET_EC_DYNAMIC || g_ActiveConfig.bCopyEFBToTexture) { g_renderer->ResetAPIState(); -- cgit v1.2.3