From 70f2577b9e3c21ddfa39cdc117575598ab246fa3 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 4 Mar 2020 22:25:31 +0300 Subject: [PATCH] vk/gl: Use best-fit semantics when scanning texture cache for flippable images - Allows sourcing flip data from the blit engine resources which avoids expensive flush and re-upload --- rpcs3/Emu/RSX/GL/GLPresent.cpp | 5 +++-- rpcs3/Emu/RSX/VK/VKPresent.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index f67436ac98..2e2109421e 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "GLGSRender.h" LOG_CHANNEL(screenshot); @@ -52,7 +52,8 @@ gl::texture* GLGSRender::get_present_source(gl::present_surface_info* info, cons } } } - else if (auto surface = m_gl_texture_cache.find_texture_from_dimensions(info->address, info->format, info->width, info->height)) + else if (auto surface = m_gl_texture_cache.find_texture_from_dimensions(info->address, info->format); + surface && surface->get_width() >= info->width && surface->get_height() >= info->height) { // Hack - this should be the first location to check for output // The render might have been done offscreen or in software and a blit used to display diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index 62242ce0f1..ce6381eee0 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -309,7 +309,8 @@ vk::image* VKGSRender::get_present_source(vk::present_surface_info* info, const } } } - else if (auto surface = m_texture_cache.find_texture_from_dimensions(info->address, info->format, info->width, info->height)) + else if (auto surface = m_texture_cache.find_texture_from_dimensions(info->address, info->format); + surface && surface->get_width() >= info->width && surface->get_height() >= info->height) { // Hack - this should be the first location to check for output // The render might have been done offscreen or in software and a blit used to display