summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage/texture_storage.cpp
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-11-11 00:17:26 +0100
committerclayjohn <claynjohn@gmail.com>2023-11-11 00:17:26 +0100
commite69968b79432d1a3f9544e70b634f8fe08cb1aa8 (patch)
tree23e027310f19f609ff6b951235374e1041999621 /drivers/gles3/storage/texture_storage.cpp
parente5bacbc4716ce5b54bc2ab8b3053cd5e22ffe446 (diff)
downloadredot-engine-e69968b79432d1a3f9544e70b634f8fe08cb1aa8.tar.gz
Only copy the relevant portion of the screen when copying to backbuffer in Compatibility backend
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r--drivers/gles3/storage/texture_storage.cpp5
1 files changed, 4 insertions, 1 deletions
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);