gl: Minor enhancements to blitter

- Move some functions to cpp. Makes it easier to debug failing image operations
- Add fbo validation before blit operations
This commit is contained in:
kd-11 2026-03-09 18:14:54 +03:00 committed by kd-11
parent 36cdaac327
commit ab72ce418e
2 changed files with 17 additions and 10 deletions

View file

@ -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<fbo::attachment::type>(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)

View file

@ -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);