Renderer: minor optimisation when running gl_compatibility mode

This commit is contained in:
Stuart Carnie 2025-01-08 09:43:35 -07:00
parent 76c8e76560
commit abd0e6990c

View File

@ -876,17 +876,16 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
blit.dst_rect.size = vp->size;
}
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")) {
Vector<BlitToScreen> blit_to_screen_vec;
blit_to_screen_vec.push_back(blit);
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 {
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;
}
blits->push_back(blit);
}
}