summaryrefslogtreecommitdiffstats
path: root/platform/web
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-12-12 00:17:16 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-12-12 00:17:16 +0100
commitae7c533937c3e20186fea7d2e52014b8c087a10d (patch)
treefa196041109d092af7882e431c415233fbf1fbd8 /platform/web
parent4943b6e6b33486fd2e0abe6d2d476dfb9c17fccf (diff)
parent275c496bc87f6cf973cfa70bc1bf4a35ecd60d1e (diff)
downloadredot-engine-ae7c533937c3e20186fea7d2e52014b8c087a10d.tar.gz
Merge pull request #84686 from dsnopek/webxr-msaa
Add MSAA support for WebXR
Diffstat (limited to 'platform/web')
-rw-r--r--platform/web/godot_webgl2.h2
-rw-r--r--platform/web/js/libs/library_godot_webgl2.externs.js16
-rw-r--r--platform/web/js/libs/library_godot_webgl2.js17
3 files changed, 35 insertions, 0 deletions
diff --git a/platform/web/godot_webgl2.h b/platform/web/godot_webgl2.h
index 3ade9e4239..2c9af4313f 100644
--- a/platform/web/godot_webgl2.h
+++ b/platform/web/godot_webgl2.h
@@ -44,9 +44,11 @@ extern "C" {
#endif
void godot_webgl2_glFramebufferTextureMultiviewOVR(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+void godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR(GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews);
void godot_webgl2_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
#define glFramebufferTextureMultiviewOVR godot_webgl2_glFramebufferTextureMultiviewOVR
+#define glFramebufferTextureMultisampleMultiviewOVR godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR
#ifdef __cplusplus
}
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');