From ab72ce418eb9d0a7b3f0482dbdc47ed565f04e29 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 9 Mar 2026 18:14:54 +0300 Subject: [PATCH] gl: Minor enhancements to blitter - Move some functions to cpp. Makes it easier to debug failing image operations - Add fbo validation before blit operations --- rpcs3/Emu/RSX/GL/glutils/blitter.cpp | 15 +++++++++++++++ rpcs3/Emu/RSX/GL/glutils/blitter.h | 12 ++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/glutils/blitter.cpp b/rpcs3/Emu/RSX/GL/glutils/blitter.cpp index 57998b761d..47c7d7b1ca 100644 --- a/rpcs3/Emu/RSX/GL/glutils/blitter.cpp +++ b/rpcs3/Emu/RSX/GL/glutils/blitter.cpp @@ -8,6 +8,18 @@ namespace gl { blitter* g_hw_blitter = nullptr; + void blitter::init() + { + blit_src.create(); + blit_dst.create(); + } + + void blitter::destroy() + { + blit_dst.remove(); + blit_src.remove(); + } + void blitter::copy_image(gl::command_context&, const texture* src, const texture* dst, int src_level, int dst_level, const position3i& src_offset, const position3i& dst_offset, const size3i& size) const { ensure(src_level == 0); @@ -147,6 +159,9 @@ namespace gl gl::fbo::attachment dst_att{ blit_dst, static_cast(attachment) }; dst_att = *real_dst; + blit_src.check(); + blit_dst.check(); + blit_src.blit(blit_dst, src_rect, dst_rect, target, interp); // Release the attachments explicitly (not doing so causes glitches, e.g Journey Menu) diff --git a/rpcs3/Emu/RSX/GL/glutils/blitter.h b/rpcs3/Emu/RSX/GL/glutils/blitter.h index d7adc1dd14..d56754fcae 100644 --- a/rpcs3/Emu/RSX/GL/glutils/blitter.h +++ b/rpcs3/Emu/RSX/GL/glutils/blitter.h @@ -30,17 +30,9 @@ namespace gl public: - void init() - { - blit_src.create(); - blit_dst.create(); - } + void init(); - void destroy() - { - blit_dst.remove(); - blit_src.remove(); - } + void destroy(); void scale_image(gl::command_context& cmd, const texture* src, texture* dst, areai src_rect, areai dst_rect, bool linear_interpolation, const rsx::typeless_xfer& xfer_info);