summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2022-10-02 13:49:53 -0500
committerDavid Snopek <dsnopek@gmail.com>2022-10-02 13:49:53 -0500
commitec5c4709bd1051ede664a806d15a1b7c9024fb40 (patch)
treed853545dd6a106d516a9d6e58d3942fbc49f9321 /servers/rendering
parent7c7a86f0fd0c1ae94099f2c1fdd878ab60dcb077 (diff)
Fix rendering in the WebXR emulator
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_viewport.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp
index 2b05e23a96..7a41a39f9b 100644
--- a/servers/rendering/renderer_viewport.cpp
+++ b/servers/rendering/renderer_viewport.cpp
@@ -678,11 +678,13 @@ void RendererViewport::draw_viewports() {
// commit our eyes
Vector<BlitToScreen> blits = xr_interface->post_draw_viewport(vp->render_target, vp->viewport_to_screen_rect);
- if (vp->viewport_to_screen != DisplayServer::INVALID_WINDOW_ID && blits.size() > 0) {
+ if (vp->viewport_to_screen != DisplayServer::INVALID_WINDOW_ID) {
if (OS::get_singleton()->get_current_rendering_driver_name() == "opengl3") {
- RSG::rasterizer->blit_render_targets_to_screen(vp->viewport_to_screen, blits.ptr(), blits.size());
+ if (blits.size() > 0) {
+ RSG::rasterizer->blit_render_targets_to_screen(vp->viewport_to_screen, blits.ptr(), blits.size());
+ }
RSG::rasterizer->end_frame(true);
- } else {
+ } else if (blits.size() > 0) {
if (!blit_to_screen_list.has(vp->viewport_to_screen)) {
blit_to_screen_list[vp->viewport_to_screen] = Vector<BlitToScreen>();
}