Fix regression around OpenGL swapchain optimisation for OpenXR

This commit is contained in:
Bastiaan Olij 2024-07-29 10:49:48 +10:00
parent 88d9325065
commit 1eb0039b6e
6 changed files with 8 additions and 8 deletions

View file

@ -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);
}

View file

@ -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();

View file

@ -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) {

View file

@ -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;

View file

@ -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();

View file

@ -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);
}
}