From bb4d636f34ab26c4c964cf83383d0694be6beb8c Mon Sep 17 00:00:00 2001 From: mimimi085181 Date: Sun, 14 Feb 2016 17:13:07 +0100 Subject: [PATCH] Copy all layers of textures with CopyRectangleFromTexture --- Source/Core/VideoBackends/D3D/TextureCache.cpp | 4 ++-- Source/Core/VideoBackends/OGL/TextureCache.cpp | 2 +- Source/Core/VideoCommon/TextureCacheBase.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp index 1403027dfc..ac8271fbb5 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp @@ -93,7 +93,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture( srcbox.right = srcrect.right; srcbox.bottom = srcrect.bottom; srcbox.front = 0; - srcbox.back = 1; + srcbox.back = srcentry->config.layers; D3D::context->CopySubresourceRegion( texture->GetTex(), @@ -130,7 +130,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture( srcentry->config.width, srcentry->config.height, PixelShaderCache::GetColorCopyProgram(false), VertexShaderCache::GetSimpleVertexShader(), - VertexShaderCache::GetSimpleInputLayout(), nullptr, 1.0, 0); + VertexShaderCache::GetSimpleInputLayout(), GeometryShaderCache::GetCopyGeometryShader(), 1.0, 0); D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index 824d16b8c1..6cd9c50359 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -168,7 +168,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture( 0, dstrect.GetWidth(), dstrect.GetHeight(), - 1); + srcentry->config.layers); return; } else if (!framebuffer) diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 106e9fa588..eb4b041c18 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -226,6 +226,7 @@ void TextureCacheBase::ScaleTextureCacheEntryTo(TextureCacheBase::TCacheEntryBas TextureCacheBase::TCacheEntryConfig newconfig; newconfig.width = new_width; newconfig.height = new_height; + newconfig.layers = (*entry)->config.layers; newconfig.rendertarget = true; TCacheEntryBase* newentry = AllocateTexture(newconfig);