I think Alon was looking too quickly: glBlitFramebuffer is implemented, but it is one of those trivial "pass-through" functions (functions that have only primitive numbers as args) so you'll find it by searching for 'blitframebuffer' rather than 'glblitframebuffer'. Its implementation is done on this line:
https://github.com/emscripten-core/emscripten/blob/7b2d3d0a3fc0d5238d5dee0371de7cc24d3542a7/src/library_webgl2.js#L1015 There is one test in the test suite that does touch glBlitframebuffer, see https://github.com/emscripten-core/emscripten/blob/7b2d3d0a3fc0d5238d5dee0371de7cc24d3542a7/tests/webgl_with_closure.cpp#L176 . See https://github.com/emscripten-core/emscripten/blob/7b2d3d0a3fc0d5238d5dee0371de7cc24d3542a7/tests/test_browser.py#L2659 for the test. It can be run from command line with "python tests/runner.py browser.test_webgl_with_closure" The flag -s USE_WEBGL2=1 is an alias/synonym to -s MAX_WEBGL_VERSION=2. (passing either one has identical behavior) -s MAX_WEBGL_VERSION=2 means that the generated build supports creating WebGL 2 contexts (in addition to supporting WebGL 1 contexts). Some of the emulated libraries (SDL,GLUT,GLFW,GLEW,... emulation stubs in src/library_x.js) will default to creating WebGL 2 contexts if -s MAX_WEBGL_VERSION=2 is passed. The html5.h API WebGL context creation function has a version field that is set to specify the desired context versoin. Passing -s MIN_WEBGL_VERSION=2 drops support for WebGL 1 altogether, to get a size micro-optimization for the build output. This is intended for pages that know they cannot operate with WebGL 1, and wish not to have to pay code size for generated WebGL 1 support functions. Try passing -lwebgl2.js explicitly on the link line if there is any oddness. Running with environment variable EMCC_DEBUG=1 and linker flag -s VERBOSE=1 may help troubleshooting some linking decisions that are being made. ti 11. helmik. 2020 klo 19.42 Alon Zakai ([email protected]) kirjoitti: > > Looking in src/*, it seems like that function is not implemented yet - it > needs to be added there. A PR would be very welcome if someone is interested! > It should be in src/library_webgl2.js. > > Linking with -s MAX_WEBGL_VERSION=2 should have been enough for this to work, > if the function were there (that says "the max version that will be used is > 2, so anything between the min version - default 1 - and the max is > supported; the default max is 1, so raising the max is necessary). > > On Mon, Feb 10, 2020 at 4:07 PM Tim Luther Lewis <[email protected]> > wrote: >> >> I tried that, although I hadn't thought of linking libraries directly like >> that (emscripten seems to do it's own thing with '-s USE_WEBGL2=1', which >> probably resolves to some library using internal magic that I haven't deep >> dived on yet) >> >> In my generated WASM.js file, I still see this: >> >> function _glBlitFramebuffer( >> ) { >> err('missing function: glBlitFramebuffer'); abort(-1); >> } >> >> Which is clearly why it's not working: it's not there! Why it's not there >> though, is still a mystery to me :/ >> >> >> On Monday, 10 February 2020 20:23:17 UTC, Charles Vaughn wrote: >>> >>> Looks like you're missing a linker input, do you have -lGLESv2 on your link >>> command? >>> >>> On Monday, February 10, 2020 at 1:01:11 AM UTC-8, Tim Luther Lewis wrote: >>>> >>>> Thanks for the responses guys but unfortunately, I'm still getting >>>> 'anthraciteWASM.js:8995 missing function: glBlitFramebuffer' >>>> >>>> I've added both '-s MIN_WEBGL_VERSION=2' and '-s MAX_WEBGL_VERSION=2' and >>>> I'm creating my context with 'const context = canvas.getContext("webgl2", >>>> {antialias: false, depth: true});' >>>> >>>> I do get a bunch of linker warnings when I build, however: >>>> >>>> ---8<------------------------------- >>>> warning: undefined symbol: emscripten_glBeginQuery >>>> warning: undefined symbol: emscripten_glBeginTransformFeedback >>>> warning: undefined symbol: emscripten_glBindBufferBase >>>> warning: undefined symbol: emscripten_glBindBufferRange >>>> warning: undefined symbol: emscripten_glBindSampler >>>> warning: undefined symbol: emscripten_glBindTransformFeedback >>>> warning: undefined symbol: emscripten_glBlitFramebuffer >>>> warning: undefined symbol: emscripten_glClearBufferfi >>>> warning: undefined symbol: emscripten_glClearBufferfv >>>> warning: undefined symbol: emscripten_glClearBufferiv >>>> warning: undefined symbol: emscripten_glClearBufferuiv >>>> warning: undefined symbol: emscripten_glClientWaitSync >>>> warning: undefined symbol: emscripten_glCompressedTexImage3D >>>> ... >>>> --8<-------------------------------------------- >>>> but seeing as everything ran fine, other than the blit, I assumed this was >>>> just some sort of late binding issue for external functions. >>>> >>>> Is it possible that there's a problem with glBlitFramebuffer that hasn't >>>> been picked up? >>>> >>>> >>>> >>>> On Sunday, 9 February 2020 20:31:49 UTC, Tim Luther Lewis wrote: >>>>> >>>>> Hi, >>>>> I'm porting my engine to WASM and it's all going well so far but I've >>>>> hit a snag with this. I'm linking with -s FULL_ES2=1 -s FULL_ES3=1 but >>>>> it still gives me 'missing function: glBlitFramebuffer' whenever I call >>>>> it. >>>>> I noticed there was a discussion about this function on github back in >>>>> February 2019 (https://github.com/emscripten-core/emscripten/pull/7588). >>>>> Does anybody know if it's broken or perhaps I've missed something vital? >>>>> >>>>> Thanks in advance, >>>>> Tim. >>>>> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/emscripten-discuss/9c7adf13-64e9-4993-8f87-f6f669a5b787%40googlegroups.com. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpT9mrc%3DczjFbhVBaG1fdChUn7WKnLnHEa9EBOg_LH6nbA%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CA%2B6sJ-0BRwJFcY48k%2Bq%2BZJ0PW5WMmThtFAf%3DKkFBxZsqw8hsMQ%40mail.gmail.com.
