Skip to content

Commit 3846ae4

Browse files
committed
retire USES_GL_EMULATION
1 parent 8ed856a commit 3846ae4

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/compiler.js

-4
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ EXPORTED_FUNCTIONS = set(EXPORTED_FUNCTIONS);
164164
EXCEPTION_CATCHING_WHITELIST = set(EXCEPTION_CATCHING_WHITELIST);
165165
IMPLEMENTED_FUNCTIONS = set(IMPLEMENTED_FUNCTIONS);
166166

167-
// TODO: Implement support for proper preprocessing, e.g. "#if A || B" and "#if defined(A) || defined(B)" to
168-
// avoid needing this here.
169-
USES_GL_EMULATION = FULL_ES2 || LEGACY_GL_EMULATION;
170-
171167
DEAD_FUNCTIONS.forEach(function(dead) {
172168
DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push(dead.substr(1));
173169
});

src/library_browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ var LibraryBrowser = {
11831183

11841184
// Signal GL rendering layer that processing of a new frame is about to start. This helps it optimize
11851185
// VBO double-buffering and reduce GPU stalls.
1186-
#if USES_GL_EMULATION
1186+
#if FULL_ES2 || LEGACY_GL_EMULATION
11871187
GL.newRenderingFrameStarted();
11881188
#endif
11891189

src/library_gl.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var LibraryGL = {
3232
syncs: [],
3333
#endif
3434

35-
#if USES_GL_EMULATION
35+
#if FULL_ES2 || LEGACY_GL_EMULATION
3636
currArrayBuffer: 0,
3737
currElementArrayBuffer: 0,
3838
#endif
@@ -69,7 +69,7 @@ var LibraryGL = {
6969
unpackAlignment: 4, // default alignment is 4 bytes
7070

7171
init: function() {
72-
#if USES_GL_EMULATION
72+
#if FULL_ES2 || LEGACY_GL_EMULATION
7373
GL.createLog2ceilLookup(GL.MAX_TEMP_BUFFER_SIZE);
7474
#endif
7575
GL.miniTempBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);
@@ -105,7 +105,7 @@ var LibraryGL = {
105105
miniTempBuffer: null,
106106
miniTempBufferViews: [0], // index i has the view of size i+1
107107

108-
#if USES_GL_EMULATION
108+
#if FULL_ES2 || LEGACY_GL_EMULATION
109109
// When user GL code wants to render from client-side memory, we need to upload the vertex data to a temp VBO
110110
// for rendering. Maintain a set of temp VBOs that are created-on-demand to appropriate sizes, and never destroyed.
111111
// Also, for best performance the VBOs are double-buffered, i.e. every second frame we switch the set of VBOs we
@@ -3537,7 +3537,7 @@ var LibraryGL = {
35373537
#endif
35383538
var bufferObj = buffer ? GL.buffers[buffer] : null;
35393539

3540-
#if USES_GL_EMULATION
3540+
#if FULL_ES2 || LEGACY_GL_EMULATION
35413541
if (target == GLctx.ARRAY_BUFFER) {
35423542
GL.currArrayBuffer = buffer;
35433543
#if LEGACY_GL_EMULATION
@@ -4176,7 +4176,7 @@ var LibraryGL = {
41764176
#endif
41774177
GLctx['bindVertexArray'](GL.vaos[vao]);
41784178
#endif
4179-
#if USES_GL_EMULATION
4179+
#if FULL_ES2 || LEGACY_GL_EMULATION
41804180
var ibo = GLctx.getParameter(GLctx.ELEMENT_ARRAY_BUFFER_BINDING);
41814181
GL.currElementArrayBuffer = ibo ? (ibo.name | 0) : 0;
41824182
#endif

src/library_vr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ var LibraryWebVR = {
190190
/* Prevent scheduler being called twice when loop is changed */
191191
display.mainLoop.running = true;
192192

193-
#if USES_GL_EMULATION
193+
#if FULL_ES2 || LEGACY_GL_EMULATION
194194
GL.newRenderingFrameStarted();
195195
#endif
196196

0 commit comments

Comments
 (0)