summaryrefslogtreecommitdiffstats
path: root/servers/rendering/renderer_viewport.cpp
diff options
context:
space:
mode:
authorStuart Carnie <stuart.carnie@gmail.com>2024-09-12 06:19:24 +1000
committerStuart Carnie <stuart.carnie@gmail.com>2024-09-12 06:22:04 +1000
commit5cfacc876796324d2d06c83c83f1a128b9687b9a (patch)
tree3a3d7f2e20ee2e40149538549fb99aeba4c2c44a /servers/rendering/renderer_viewport.cpp
parent14a7e0abb313915fc5e4f36b34f9169b1d45774c (diff)
downloadredot-engine-5cfacc876796324d2d06c83c83f1a128b9687b9a.tar.gz
[Editor,Servers]: Minor optimizations
Diffstat (limited to 'servers/rendering/renderer_viewport.cpp')
-rw-r--r--servers/rendering/renderer_viewport.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp
index 7e45eba1de..781d29ffaa 100644
--- a/servers/rendering/renderer_viewport.cpp
+++ b/servers/rendering/renderer_viewport.cpp
@@ -818,8 +818,9 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
blit.dst_rect.size = vp->size;
}
- if (!blit_to_screen_list.has(vp->viewport_to_screen)) {
- blit_to_screen_list[vp->viewport_to_screen] = Vector<BlitToScreen>();
+ Vector<BlitToScreen> *blits = blit_to_screen_list.getptr(vp->viewport_to_screen);
+ if (blits == nullptr) {
+ blits = &blit_to_screen_list.insert(vp->viewport_to_screen, Vector<BlitToScreen>())->value;
}
if (OS::get_singleton()->get_current_rendering_driver_name().begins_with("opengl3")) {
@@ -828,7 +829,7 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
RSG::rasterizer->blit_render_targets_to_screen(vp->viewport_to_screen, blit_to_screen_vec.ptr(), 1);
RSG::rasterizer->gl_end_frame(p_swap_buffers);
} else {
- blit_to_screen_list[vp->viewport_to_screen].push_back(blit);
+ blits->push_back(blit);
}
}
}