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/Vulkan/TextureCache.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index 984aa95db9..edd2d4165d 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -88,13 +88,8 @@ void TextureCache::ConvertTexture(TCacheEntryBase* base_entry, TCacheEntryBase* m_texture_converter->ConvertTexture(entry, unconverted, m_render_pass, palette, format); } -static bool IsDepthCopyFormat(PEControl::PixelFormat format) -{ - return format == PEControl::Z24; -} - void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_row, - u32 num_blocks_y, u32 memory_stride, PEControl::PixelFormat src_format, + u32 num_blocks_y, u32 memory_stride, bool is_depth_copy, const EFBRectangle& src_rect, bool is_intensity, bool scale_by_half) { // Flush EFB pokes first, as they're expected to be included. @@ -107,7 +102,7 @@ void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_ {static_cast(scaled_src_rect.GetWidth()), static_cast(scaled_src_rect.GetHeight())}}; Texture2D* src_texture; - if (IsDepthCopyFormat(src_format)) + if (is_depth_copy) src_texture = FramebufferManager::GetInstance()->ResolveEFBDepthTexture(region); else src_texture = FramebufferManager::GetInstance()->ResolveEFBColorTexture(region); @@ -124,8 +119,8 @@ void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); m_texture_converter->EncodeTextureToMemory(src_texture->GetView(), dst, format, native_width, - bytes_per_row, num_blocks_y, memory_stride, src_format, - is_intensity, scale_by_half, src_rect); + bytes_per_row, num_blocks_y, memory_stride, + is_depth_copy, is_intensity, scale_by_half, src_rect); // Transition back to original state src_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(), original_layout); @@ -436,7 +431,7 @@ void TextureCache::TCacheEntry::Load(const u8* buffer, unsigned int width, unsig } } -void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat src_format, +void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, bool is_depth_copy, const EFBRectangle& src_rect, bool scale_by_half, unsigned int cbufid, const float* colmat) { @@ -444,7 +439,6 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat FramebufferManager* framebuffer_mgr = static_cast(g_framebuffer_manager.get()); TargetRectangle scaled_src_rect = g_renderer->ConvertEFBRectangle(src_rect); - bool is_depth_copy = IsDepthCopyFormat(src_format); // Flush EFB pokes first, as they're expected to be included. framebuffer_mgr->FlushEFBPokes(); -- 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/Vulkan/TextureCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index edd2d4165d..5a73106476 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -431,9 +431,9 @@ void TextureCache::TCacheEntry::Load(const u8* buffer, unsigned int width, unsig } } -void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, bool is_depth_copy, - const EFBRectangle& src_rect, bool scale_by_half, - unsigned int cbufid, const float* colmat) +void TextureCache::TCacheEntry::FromRenderTarget(bool is_depth_copy, const EFBRectangle& src_rect, + bool scale_by_half, unsigned int cbufid, + const float* colmat) { // A better way of doing this would be nice. FramebufferManager* framebuffer_mgr = -- cgit v1.2.3