1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

[HTML5] Use compatibility function for glGetBufferSubData.

The "webgl/webgl2.h" include provides that function, but it's not
available in emscripten versions < 2.0.17 .

Since we need to support emscripten 1.39.9 (mono builds), this commit
adds a JS function in library_godot_display.js as a compatibility layer
for it, and implement glGetBufferSubData by funneling the call to that
function (so we don't have name collisions JS-side with recent emcc).

All those hacks are now moved to the platform directory instead of being
ifdefs inside the drivers implementations.

(cherry picked from commit bbfe054175)
This commit is contained in:
Fabio Alessandrelli
2021-11-26 10:36:56 +01:00
committed by Rémi Verschelde
parent 8fb897ecfa
commit 35b7e86e6e
6 changed files with 91 additions and 5 deletions

View File

@@ -44,11 +44,6 @@
#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 via glGetBufferSubData instead.
#ifdef __EMSCRIPTEN__
#include <webgl/webgl2.h>
#endif
class RasterizerCanvasGLES3;
class RasterizerSceneGLES3;