mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Renderer: minor optimisation when running gl_compatibility
mode
This commit is contained in:
parent
76c8e76560
commit
abd0e6990c
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user