From 3aa79fc1a32f505f71c88e58023d728a225353e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 30 Oct 2017 21:33:36 +0100 Subject: Add ability to opt-out buffer swapping in `VS::draw()` --- drivers/gles3/rasterizer_gles3.cpp | 7 +++++-- drivers/gles3/rasterizer_gles3.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/gles3') diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index ee61481a86..b34aec089d 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -352,7 +352,7 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re canvas->canvas_end(); } -void RasterizerGLES3::end_frame() { +void RasterizerGLES3::end_frame(bool p_swap_buffers) { #if 0 canvas->canvas_begin(); @@ -384,7 +384,10 @@ void RasterizerGLES3::end_frame() { canvas->draw_generic_textured_rect(Rect2(0,0,15,15),Rect2(0,0,1,1)); #endif - OS::get_singleton()->swap_buffers(); + if (p_swap_buffers) + OS::get_singleton()->swap_buffers(); + else + glFinish(); /* print_line("objects: "+itos(storage->info.render_object_count)); print_line("material chages: "+itos(storage->info.render_material_switch_count)); diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h index 4bfec09bf3..c27af7d019 100644 --- a/drivers/gles3/rasterizer_gles3.h +++ b/drivers/gles3/rasterizer_gles3.h @@ -59,7 +59,7 @@ public: virtual void restore_render_target(); virtual void clear_render_target(const Color &p_color); virtual void blit_render_target_to_screen(RID p_render_target, const Rect2 &p_screen_rect, int p_screen = 0); - virtual void end_frame(); + virtual void end_frame(bool p_swap_buffers); virtual void finalize(); static void make_current(); -- cgit v1.2.3