From 4d83d749a0cfc846f070890764732e99a47be8bc Mon Sep 17 00:00:00 2001 From: kd-11 Date: Thu, 21 Sep 2017 21:00:42 +0300 Subject: [PATCH] rsx: Texture cache fixes - Update section flags when requested - Fix nullptr dereference: cached_dest will be null if dst_is_render_target is true --- rpcs3/Emu/RSX/Common/texture_cache.h | 17 +++++++++++------ rpcs3/Emu/RSX/VK/VKTextureCache.h | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 3fa96b8638..727754cfcf 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1121,14 +1121,19 @@ namespace rsx { if (dest_texture) { - if (dst_is_render_target && !dst_subres.is_depth_surface) + if (dst_is_render_target) { - LOG_ERROR(RSX, "Depth->RGBA blit requested but not supported"); - return true; + if (!dst_subres.is_depth_surface) + { + LOG_ERROR(RSX, "Depth->RGBA blit requested but not supported"); + return true; + } + } + else + { + if (!cached_dest->has_compatible_format(src_subres.surface)) + format_mismatch = true; } - - if (!cached_dest->has_compatible_format(src_subres.surface)) - format_mismatch = true; } is_depth_blit = true; diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 76fa03f312..9feecb8b76 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -572,6 +572,8 @@ namespace vk view.reset(new_view); } + + section.set_view_flags(expected_flags); } void insert_texture_barrier() override