summaryrefslogtreecommitdiffstats
path: root/platform/web/js
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-11-08 14:54:29 -0600
committerDavid Snopek <dsnopek@gmail.com>2023-12-11 09:01:24 -0600
commit275c496bc87f6cf973cfa70bc1bf4a35ecd60d1e (patch)
treea706a50c6db17a1eaf6f4df9f36d305f33c3835b /platform/web/js
parenta311a4b162364d032b03ddf2a0e603ba40615ad7 (diff)
downloadredot-engine-275c496bc87f6cf973cfa70bc1bf4a35ecd60d1e.tar.gz
Add MSAA support for WebXR
Diffstat (limited to 'platform/web/js')
-rw-r--r--platform/web/js/libs/library_godot_webgl2.externs.js16
-rw-r--r--platform/web/js/libs/library_godot_webgl2.js17
2 files changed, 33 insertions, 0 deletions
diff --git a/platform/web/js/libs/library_godot_webgl2.externs.js b/platform/web/js/libs/library_godot_webgl2.externs.js
index 18d8d0815a..99190ab009 100644
--- a/platform/web/js/libs/library_godot_webgl2.externs.js
+++ b/platform/web/js/libs/library_godot_webgl2.externs.js
@@ -34,3 +34,19 @@ OVR_multiview2.prototype.FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR;
* @return {void}
*/
OVR_multiview2.prototype.framebufferTextureMultiviewOVR = function(target, attachment, texture, level, baseViewIndex, numViews) {};
+
+/**
+ * @constructor OCULUS_multiview
+ */
+function OCULUS_multiview() {}
+
+/**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {WebGLTexture} texture
+ * @param {number} level
+ * @param {number} baseViewIndex
+ * @param {number} numViews
+ * @return {void}
+ */
+OCULUS_multiview.prototype.framebufferTextureMultisampleMultiviewOVR = function(target, attachment, texture, level, samples, baseViewIndex, numViews) {};
diff --git a/platform/web/js/libs/library_godot_webgl2.js b/platform/web/js/libs/library_godot_webgl2.js
index dbaec9f01b..005b4b7917 100644
--- a/platform/web/js/libs/library_godot_webgl2.js
+++ b/platform/web/js/libs/library_godot_webgl2.js
@@ -61,6 +61,23 @@ const GodotWebGL2 = {
const /** OVR_multiview2 */ ext = context.multiviewExt;
ext.framebufferTextureMultiviewOVR(target, attachment, GL.textures[texture], level, base_view_index, num_views);
},
+
+ godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__deps: ['emscripten_webgl_get_current_context'],
+ godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__proxy: 'sync',
+ godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__sig: 'viiiiiii',
+ godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR: function (target, attachment, texture, level, samples, base_view_index, num_views) {
+ const context = GL.currentContext;
+ if (typeof context.oculusMultiviewExt === 'undefined') {
+ const /** OCULUS_multiview */ ext = context.GLctx.getExtension('OCULUS_multiview');
+ if (!ext) {
+ GodotRuntime.error('Trying to call glFramebufferTextureMultisampleMultiviewOVR() without the OCULUS_multiview extension');
+ return;
+ }
+ context.oculusMultiviewExt = ext;
+ }
+ const /** OCULUS_multiview */ ext = context.oculusMultiviewExt;
+ ext.framebufferTextureMultisampleMultiviewOVR(target, attachment, GL.textures[texture], level, samples, base_view_index, num_views);
+ },
};
autoAddDeps(GodotWebGL2, '$GodotWebGL2');