diff --git a/rpcs3/Emu/RSX/Common/surface_store.h b/rpcs3/Emu/RSX/Common/surface_store.h index b16528d471..ac677ddcd0 100644 --- a/rpcs3/Emu/RSX/Common/surface_store.h +++ b/rpcs3/Emu/RSX/Common/surface_store.h @@ -427,11 +427,17 @@ namespace rsx if (Traits::surface_matches_properties(surface, format, width, height, antialias)) { - if (pitch_compatible) - Traits::notify_surface_persist(surface); - else - Traits::invalidate_surface_contents(command_list, Traits::get(surface), address, pitch); + if (!pitch_compatible) + { + // This object should be pitch-converted and re-intersected with + if (old_surface_storage = Traits::convert_pitch(command_list, surface, pitch)) + { + old_surface = Traits::get(old_surface_storage); + Traits::invalidate_surface_contents(command_list, Traits::get(surface), address, pitch); + } + } + Traits::notify_surface_persist(surface); Traits::prepare_surface_for_drawing(command_list, Traits::get(surface)); new_surface = Traits::get(surface); store = false; diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.h b/rpcs3/Emu/RSX/GL/GLRenderTargets.h index 0cabb74bd9..20f737dc8b 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.h +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.h @@ -234,6 +234,17 @@ struct gl_render_target_traits sink->raster_type = ref->raster_type; // Can't actually cut up swizzled data } + static + std::unique_ptr convert_pitch( + gl::command_context& /*cmd*/, + std::unique_ptr& src, + usz out_pitch) + { + // TODO + src->set_rsx_pitch(static_cast(out_pitch)); + return {}; + } + static bool is_compatible_surface(const gl::render_target* surface, const gl::render_target* ref, u16 width, u16 height, u8 sample_count) { diff --git a/rpcs3/Emu/RSX/VK/VKRenderTargets.h b/rpcs3/Emu/RSX/VK/VKRenderTargets.h index 4f57d34682..a06bc81643 100644 --- a/rpcs3/Emu/RSX/VK/VKRenderTargets.h +++ b/rpcs3/Emu/RSX/VK/VKRenderTargets.h @@ -329,6 +329,16 @@ namespace vk sink->raster_type = ref->raster_type; // Can't actually cut up swizzled data } + static std::unique_ptr convert_pitch( + vk::command_buffer& /*cmd*/, + std::unique_ptr& src, + usz out_pitch) + { + // TODO + src->rsx_pitch = static_cast(out_pitch); + return {}; + } + static bool is_compatible_surface(const vk::render_target* surface, const vk::render_target* ref, u16 width, u16 height, u8 sample_count) { return (surface->format() == ref->format() &&