From 340ecb93be812cb76c29dbdf0c1b2d7afc8466b0 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 14 Jun 2021 14:26:53 +0200 Subject: [PATCH] [HTML5] Call glGetBufferSubData directly from C++. Remove leftover EM_ASM causing problems with gdnative builds. --- drivers/gles3/rasterizer_storage_gles3.cpp | 12 ------------ drivers/gles3/rasterizer_storage_gles3.h | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index ad255047884..20cea5a1459 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -119,18 +119,6 @@ #define glClearDepth glClearDepthf #endif -#ifdef __EMSCRIPTEN__ -#include - -void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data) { - /* clang-format off */ - EM_ASM({ - GLctx.getBufferSubData($0, $1, HEAPU8, $2, $3); - }, target, offset, data, size); - /* clang-format on */ -} -#endif - void glTexStorage2DCustom(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type) { #ifdef GLES_OVER_GL diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 934f2938352..e296341d06b 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -45,9 +45,9 @@ #include "shaders/cubemap_filter.glsl.gen.h" #include "shaders/particles.glsl.gen.h" -// WebGL 2.0 has no MapBufferRange/UnmapBuffer, but offers a non-ES style BufferSubData API instead. +// WebGL 2.0 has no MapBufferRange/UnmapBuffer, but offers a non-ES style BufferSubData API via glGetBufferSubData instead. #ifdef __EMSCRIPTEN__ -void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +#include #endif template