There is no such thing as the link not being implemented. The function
is implemented in library_webgl2.js, there is nothing more to
implement.
Trying out a test program test.c with
#include <GLES3/gl3.h>
#include <emscripten/html5.h>
int main()
{
EmscriptenWebGLContextAttributes attr;
emscripten_webgl_init_context_attributes(&attr);
attr.majorVersion = 2;
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx =
emscripten_webgl_create_context("#canvas", &attr);
emscripten_webgl_make_context_current(ctx);
glBlitFramebuffer(0, 0, 0, 0, 1, 1, 1, 1, GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
build with emcc test.c -s MAX_WEBGL_VERSION=2 -o a.html
does succeed for me, and the resulting a.js has
function _glBlitFramebuffer(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9)
{ GLctx['blitFramebuffer'](x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) }
The issue is somewhere else. Perhaps you can correlate your build
against the test build, and/or verify that the test build works for
you?
ke 12. helmik. 2020 klo 2.11 Tim Luther Lewis ([email protected])
kirjoitti:
>
> Thanks for the reply JJ. So, it seems like the link's not implemented yet
> then.
> I tried hacking my own in ealier and it failed but I gave it another go just
> now,
> hacking in this line in my generated 'anthraciteWASM.js' file and lo and
> behold it kinda worked. The buffer's being copied alright: it looks a little
> off but I think that might be down to other small discrepancies between my
> desktop build and WASM.
> Progress though: I've got some full screen effects now. Is there any chance
> that somebody can implement the function in the library as below?
>
> function _glBlitFramebuffer(a,b,c,d,e,f,g,h,i,j) {
> GLctx["blitFramebuffer"](a,b,c,d,e,f,g,h,i,j);
>
> }
>
>
>
> On Tuesday, 11 February 2020 18:26:16 UTC, jj wrote:
>>
>> 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/0db7c526-95c7-4619-b366-8912ae71f1b1%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/CA%2B6sJ-3ttjVLSFMwYM6p3hWDVPF9pVdpFqU-LKaNUMJmc7gZEw%40mail.gmail.com.