summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2024-07-29 10:49:48 +1000
committerBastiaan Olij <mux213@gmail.com>2024-07-29 12:46:58 +1000
commit1eb0039b6eae3f4fab75ca6bb746712a233d32cb (patch)
treeec564d64e8a4cf47838008ab7a9feb8b9a4a8a08
parent88d9325065a3e00e9e168ffad4ff93e12455a357 (diff)
downloadredot-engine-1eb0039b6eae3f4fab75ca6bb746712a233d32cb.tar.gz
Fix regression around OpenGL swapchain optimisation for OpenXR
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp4
-rw-r--r--drivers/gles3/rasterizer_gles3.h2
-rw-r--r--servers/rendering/dummy/rasterizer_dummy.h2
-rw-r--r--servers/rendering/renderer_compositor.h2
-rw-r--r--servers/rendering/renderer_rd/renderer_compositor_rd.h2
-rw-r--r--servers/rendering/renderer_viewport.cpp4
6 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 5ff95391a2..37e7256d76 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -107,7 +107,7 @@ void RasterizerGLES3::end_frame(bool p_swap_buffers) {
utils->capture_timestamps_end();
}
-void RasterizerGLES3::end_viewport(bool p_swap_buffers) {
+void RasterizerGLES3::gl_end_frame(bool p_swap_buffers) {
if (p_swap_buffers) {
DisplayServer::get_singleton()->swap_buffers();
} else {
@@ -491,7 +491,7 @@ void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_c
copy_effects->copy_to_rect(screenrect);
glBindTexture(GL_TEXTURE_2D, 0);
- end_viewport(true);
+ gl_end_frame(true);
texture_storage->texture_free(texture);
}
diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h
index 0d0c26016d..80a4a792bb 100644
--- a/drivers/gles3/rasterizer_gles3.h
+++ b/drivers/gles3/rasterizer_gles3.h
@@ -99,7 +99,7 @@ public:
void blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount);
- void end_viewport(bool p_swap_buffers);
+ void gl_end_frame(bool p_swap_buffers);
void end_frame(bool p_swap_buffers);
void finalize();
diff --git a/servers/rendering/dummy/rasterizer_dummy.h b/servers/rendering/dummy/rasterizer_dummy.h
index a4f353359a..c3f5f3102d 100644
--- a/servers/rendering/dummy/rasterizer_dummy.h
+++ b/servers/rendering/dummy/rasterizer_dummy.h
@@ -88,7 +88,7 @@ public:
void blit_render_targets_to_screen(int p_screen, const BlitToScreen *p_render_targets, int p_amount) override {}
- void end_viewport(bool p_swap_buffers) override {}
+ void gl_end_frame(bool p_swap_buffers) override {}
void end_frame(bool p_swap_buffers) override {
if (p_swap_buffers) {
diff --git a/servers/rendering/renderer_compositor.h b/servers/rendering/renderer_compositor.h
index ab789d5b4d..933b9e457f 100644
--- a/servers/rendering/renderer_compositor.h
+++ b/servers/rendering/renderer_compositor.h
@@ -98,7 +98,7 @@ public:
virtual void blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount) = 0;
- virtual void end_viewport(bool p_swap_buffers) = 0;
+ virtual void gl_end_frame(bool p_swap_buffers) = 0;
virtual void end_frame(bool p_swap_buffers) = 0;
virtual void finalize() = 0;
virtual uint64_t get_frame_number() const = 0;
diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.h b/servers/rendering/renderer_rd/renderer_compositor_rd.h
index 95c2b812d9..0222a99577 100644
--- a/servers/rendering/renderer_rd/renderer_compositor_rd.h
+++ b/servers/rendering/renderer_rd/renderer_compositor_rd.h
@@ -122,7 +122,7 @@ public:
void begin_frame(double frame_step);
void blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount);
- void end_viewport(bool p_swap_buffers) {}
+ void gl_end_frame(bool p_swap_buffers) {}
void end_frame(bool p_swap_buffers);
void finalize();
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp
index 10e295ab04..1049cb63cd 100644
--- a/servers/rendering/renderer_viewport.cpp
+++ b/servers/rendering/renderer_viewport.cpp
@@ -786,6 +786,7 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
if (OS::get_singleton()->get_current_rendering_driver_name().begins_with("opengl3")) {
if (blits.size() > 0) {
RSG::rasterizer->blit_render_targets_to_screen(vp->viewport_to_screen, blits.ptr(), blits.size());
+ RSG::rasterizer->gl_end_frame(p_swap_buffers);
}
} else if (blits.size() > 0) {
if (!blit_to_screen_list.has(vp->viewport_to_screen)) {
@@ -796,7 +797,6 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
blit_to_screen_list[vp->viewport_to_screen].push_back(blits[b]);
}
}
- RSG::rasterizer->end_viewport(p_swap_buffers && blits.size() > 0);
}
}
} else
@@ -826,10 +826,10 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) {
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 {
blit_to_screen_list[vp->viewport_to_screen].push_back(blit);
}
- RSG::rasterizer->end_viewport(p_swap_buffers);
}
}