Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_renderViaOffscreenBackBuffer_init_and_creation_test #6986

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

@kripken kripken Aug 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was the removal of the return 0 intentional? (so now it will warn and continue? sounds ok to me)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, removed that because I don't want to afford to make this check in non-OFFSCREEN_FRAMEBUFFER builds. Then, the return 0; behavior would only be present if GL_DEBUG is set, but that does not feel good - one doesn't want to change runtime behavior depending on a debug flag - so best is to demote the print to a debug time warning only.

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