From e69968b79432d1a3f9544e70b634f8fe08cb1aa8 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 11 Nov 2023 00:17:26 +0100 Subject: Only copy the relevant portion of the screen when copying to backbuffer in Compatibility backend --- drivers/gles3/storage/texture_storage.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gles3/storage/texture_storage.cpp') diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index fcc1dee3e2..3e8ea10ff8 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -2599,7 +2599,10 @@ void TextureStorage::render_target_copy_to_back_buffer(RID p_render_target, cons glBindFramebuffer(GL_FRAMEBUFFER, rt->backbuffer_fbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, rt->color); - GLES3::CopyEffects::get_singleton()->copy_screen(); + Rect2 normalized_region = region; + normalized_region.position = normalized_region.position / Size2(rt->size); + normalized_region.size = normalized_region.size / Size2(rt->size); + GLES3::CopyEffects::get_singleton()->copy_to_and_from_rect(normalized_region); if (p_gen_mipmaps) { GLES3::CopyEffects::get_singleton()->gaussian_blur(rt->backbuffer, rt->mipmap_count, region, rt->size); -- cgit v1.2.3