From 04f319066dd13917dc652855eec3614bc79c56f7 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 26 Dec 2016 20:54:37 +0100 Subject: TextureCache: Extract BP enum check to VideoCommon. We have TOO many video backends. --- Source/Core/VideoBackends/D3D12/TextureCache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Source/Core/VideoBackends/D3D12/TextureCache.cpp') diff --git a/Source/Core/VideoBackends/D3D12/TextureCache.cpp b/Source/Core/VideoBackends/D3D12/TextureCache.cpp index deb3bab6e7..11ba46733c 100644 --- a/Source/Core/VideoBackends/D3D12/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D12/TextureCache.cpp @@ -229,7 +229,7 @@ TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntry } } -void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat src_format, +void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, bool is_depth_copy, const EFBRectangle& srcRect, bool scale_by_half, unsigned int cbuf_id, const float* colmat) { @@ -237,14 +237,13 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat // This is because multisampled texture reads go through Load, not Sample, and the linear // filter is ignored. bool multisampled = (g_ActiveConfig.iMultisamples > 1); - D3DTexture2D* efb_tex = (src_format == PEControl::Z24) ? - FramebufferManager::GetEFBDepthTexture() : - FramebufferManager::GetEFBColorTexture(); + D3DTexture2D* efb_tex = is_depth_copy ? FramebufferManager::GetEFBDepthTexture() : + FramebufferManager::GetEFBColorTexture(); if (multisampled && scale_by_half) { multisampled = false; - efb_tex = (src_format == PEControl::Z24) ? FramebufferManager::GetResolvedEFBDepthTexture() : - FramebufferManager::GetResolvedEFBColorTexture(); + efb_tex = is_depth_copy ? FramebufferManager::GetResolvedEFBDepthTexture() : + FramebufferManager::GetResolvedEFBColorTexture(); } // set transformation @@ -286,8 +285,8 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat // Create texture copy D3D::DrawShadedTexQuad( efb_tex, &sourcerect, Renderer::GetTargetWidth(), Renderer::GetTargetHeight(), - (src_format == PEControl::Z24) ? StaticShaderCache::GetDepthMatrixPixelShader(multisampled) : - StaticShaderCache::GetColorMatrixPixelShader(multisampled), + is_depth_copy ? StaticShaderCache::GetDepthMatrixPixelShader(multisampled) : + StaticShaderCache::GetColorMatrixPixelShader(multisampled), StaticShaderCache::GetSimpleVertexShader(), StaticShaderCache::GetSimpleVertexShaderInputLayout(), StaticShaderCache::GetCopyGeometryShader(), 1.0f, 0, DXGI_FORMAT_R8G8B8A8_UNORM, false, @@ -305,11 +304,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat } void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_row, - u32 num_blocks_y, u32 memory_stride, PEControl::PixelFormat srcFormat, + u32 num_blocks_y, u32 memory_stride, bool is_depth_copy, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf) { s_encoder->Encode(dst, format, native_width, bytes_per_row, num_blocks_y, memory_stride, - srcFormat, srcRect, isIntensity, scaleByHalf); + is_depth_copy, srcRect, isIntensity, scaleByHalf); } static const constexpr char s_palette_shader_hlsl[] = -- cgit v1.2.3 From abf9bb170bf954220a50921a10f57eaa30e17779 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 26 Dec 2016 21:33:57 +0100 Subject: TextureCache: Drop unused parameter in backend API. --- Source/Core/VideoBackends/D3D12/TextureCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/D3D12/TextureCache.cpp') diff --git a/Source/Core/VideoBackends/D3D12/TextureCache.cpp b/Source/Core/VideoBackends/D3D12/TextureCache.cpp index 11ba46733c..f30c6abd7d 100644 --- a/Source/Core/VideoBackends/D3D12/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D12/TextureCache.cpp @@ -229,9 +229,9 @@ TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntry } } -void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, bool is_depth_copy, - const EFBRectangle& srcRect, bool scale_by_half, - unsigned int cbuf_id, const float* colmat) +void TextureCache::TCacheEntry::FromRenderTarget(bool is_depth_copy, const EFBRectangle& srcRect, + bool scale_by_half, unsigned int cbuf_id, + const float* colmat) { // When copying at half size, in multisampled mode, resolve the color/depth buffer first. // This is because multisampled texture reads go through Load, not Sample, and the linear -- cgit v1.2.3