summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-21 09:05:37 +0200
committerGitHub <noreply@github.com>2021-07-21 09:05:37 +0200
commita255b186bc2c09a7e746bf2936ab7f28c2f7f72f (patch)
tree7930e59891ce8f95813c938d02ff030ce823c8d8 /modules
parent60b4556ed097a787d6adb5918d746aa83a3797a2 (diff)
parent3963a11b2fe8232a4000ea06727dee6a7f69b8b9 (diff)
Merge pull request #50563 from dsnopek/webxr-enable-ci
Re-enable building WebXR in GitHub Actions
Diffstat (limited to 'modules')
-rw-r--r--modules/webxr/webxr_interface_js.cpp17
-rw-r--r--modules/webxr/webxr_interface_js.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp
index 6957dea8c4..7945334491 100644
--- a/modules/webxr/webxr_interface_js.cpp
+++ b/modules/webxr/webxr_interface_js.cpp
@@ -35,6 +35,7 @@
#include "core/os/os.h"
#include "emscripten.h"
#include "godot_webxr.h"
+#include "servers/rendering/renderer_compositor.h"
#include <stdlib.h>
void _emwebxr_on_session_supported(char *p_session_mode, int p_supported) {
@@ -376,6 +377,22 @@ void WebXRInterfaceJS::commit_for_eye(XRInterface::Eyes p_eye, RID p_render_targ
return;
}
godot_webxr_commit_for_eye(p_eye);
+}
+
+Vector<BlitToScreen> WebXRInterfaceJS::commit_views(RID p_render_target, const Rect2 &p_screen_rect) {
+ Vector<BlitToScreen> blit_to_screen;
+
+ if (!initialized) {
+ return blit_to_screen;
+ }
+
+ // @todo Refactor this to be based on "views" rather than "eyes".
+ godot_webxr_commit_for_eye(XRInterface::EYE_LEFT);
+ if (godot_webxr_get_view_count() > 1) {
+ godot_webxr_commit_for_eye(XRInterface::EYE_RIGHT);
+ }
+
+ return blit_to_screen;
};
void WebXRInterfaceJS::process() {
diff --git a/modules/webxr/webxr_interface_js.h b/modules/webxr/webxr_interface_js.h
index 3b5509adeb..f9368582b7 100644
--- a/modules/webxr/webxr_interface_js.h
+++ b/modules/webxr/webxr_interface_js.h
@@ -89,6 +89,7 @@ public:
virtual CameraMatrix get_projection_for_view(uint32_t p_view, real_t p_aspect, real_t p_z_near, real_t p_z_far) override;
virtual unsigned int get_external_texture_for_eye(XRInterface::Eyes p_eye) override;
virtual void commit_for_eye(XRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) override;
+ virtual Vector<BlitToScreen> commit_views(RID p_render_target, const Rect2 &p_screen_rect) override;
virtual void process() override;
virtual void notification(int p_what) override;