Skip to content

Commit

Permalink
Move renderViaOffscreenBackBuffer/OFFSCREEN_FRAMEBUFFER enabling test…
Browse files Browse the repository at this point in the history
… behind GL_DEBUG for 'do not pay for what you do not use', and add missing initialization of renderViaOffscreenBackBuffer field.
  • Loading branch information
juj committed Aug 14, 2018
1 parent 21c898c commit fa20d27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/library_gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,15 @@ var LibraryGL = {
GL.initExtensions(context);
}

if (webGLContextAttributes['renderViaOffscreenBackBuffer']) {
#if OFFSCREEN_FRAMEBUFFER
GL.createOffscreenFramebuffer(context);
if (webGLContextAttributes['renderViaOffscreenBackBuffer']) GL.createOffscreenFramebuffer(context);
#else

#if GL_DEBUG
Module.printErr('renderViaOffscreenBackBuffer=true specified in WebGL context creation attributes, pass linker flag -s OFFSCREEN_FRAMEBUFFER=1 to enable support!');
#endif
return 0;
if (webGLContextAttributes['renderViaOffscreenBackBuffer']) err('renderViaOffscreenBackBuffer=true specified in WebGL context creation attributes, pass linker flag -s OFFSCREEN_FRAMEBUFFER=1 to enable support!');
#endif
}

#endif
return handle;
},

Expand Down
1 change: 1 addition & 0 deletions src/library_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,7 @@ var LibraryJSEvents = {
{{{ makeSetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.minorVersion, 0, 'i32') }}};
{{{ makeSetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.enableExtensionsByDefault, 1, 'i32') }}};
{{{ makeSetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.explicitSwapControl, 0, 'i32') }}};
{{{ makeSetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.renderViaOffscreenBackBuffer, 0, 'i32') }}};
},

emscripten_webgl_create_context__deps: ['$GL'],
Expand Down

0 comments on commit fa20d27

Please sign in to comment.