Skip to content

Commit

Permalink
Merge pull request #101298 from stuartcarnie/rendering_server
Browse files Browse the repository at this point in the history
Renderer: Minor optimisation when running `gl_compatibility` mode
  • Loading branch information
akien-mga committed Jan 8, 2025
2 parents bfa351c + abd0e69 commit a659548
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions servers/rendering/renderer_viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit a659548

Please sign in to comment.