Skip to content

Commit a977211

Browse files
committed
retire USES_GL_EMULATION
1 parent 5297f33 commit a977211

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
@@ -169,10 +169,6 @@ EXPORTED_FUNCTIONS = set(EXPORTED_FUNCTIONS);
169169
EXCEPTION_CATCHING_WHITELIST = set(EXCEPTION_CATCHING_WHITELIST);
170170
IMPLEMENTED_FUNCTIONS = set(IMPLEMENTED_FUNCTIONS);
171171

172-
// TODO: Implement support for proper preprocessing, e.g. "#if A || B" and "#if defined(A) || defined(B)" to
173-
// avoid needing this here.
174-
USES_GL_EMULATION = FULL_ES2 || LEGACY_GL_EMULATION;
175-
176172
DEAD_FUNCTIONS.forEach(function(dead) {
177173
DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push(dead.substr(1));
178174
});

src/library_browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ var LibraryBrowser = {
11881188

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

src/library_gl.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var LibraryGL = {
4040
syncs: [],
4141
#endif
4242

43-
#if USES_GL_EMULATION
43+
#if FULL_ES2 || LEGACY_GL_EMULATION
4444
currArrayBuffer: 0,
4545
currElementArrayBuffer: 0,
4646
#endif
@@ -77,7 +77,7 @@ var LibraryGL = {
7777
unpackAlignment: 4, // default alignment is 4 bytes
7878

7979
init: function() {
80-
#if USES_GL_EMULATION
80+
#if FULL_ES2 || LEGACY_GL_EMULATION
8181
GL.createLog2ceilLookup(GL.MAX_TEMP_BUFFER_SIZE);
8282
#endif
8383
GL.miniTempBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);
@@ -113,7 +113,7 @@ var LibraryGL = {
113113
miniTempBuffer: null,
114114
miniTempBufferViews: [0], // index i has the view of size i+1
115115

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

3645-
#if USES_GL_EMULATION
3645+
#if FULL_ES2 || LEGACY_GL_EMULATION
36463646
if (target == GLctx.ARRAY_BUFFER) {
36473647
GL.currArrayBuffer = buffer;
36483648
#if LEGACY_GL_EMULATION
@@ -4282,7 +4282,7 @@ var LibraryGL = {
42824282
#endif
42834283
GLctx['bindVertexArray'](GL.vaos[vao]);
42844284
#endif
4285-
#if USES_GL_EMULATION
4285+
#if FULL_ES2 || LEGACY_GL_EMULATION
42864286
var ibo = GLctx.getParameter(GLctx.ELEMENT_ARRAY_BUFFER_BINDING);
42874287
GL.currElementArrayBuffer = ibo ? (ibo.name | 0) : 0;
42884288
#endif

src/library_vr.js

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

198-
#if USES_GL_EMULATION
198+
#if FULL_ES2 || LEGACY_GL_EMULATION
199199
GL.newRenderingFrameStarted();
200200
#endif
201201

0 commit comments

Comments
 (0)