On Thu, Mar 23, 2023 at 6:52 AM Thaina Yu <thain...@gmail.com> wrote:
> Do we have anyway to write hand-written assembly code along with > emscripten? And is it possible to return that externref from wasm code into > emscripten world? Here is the example how to use externref in assembly: https://github.com/emscripten-core/emscripten/blob/main/test/core/test_externref.s Until recently there was no way to communicate those references directly to C++ but it maybe possible now that upstream clan support has landed. There is no current support for externref in EM_ASM. We could potentially add EM_ASM_REF which returns a ref to C/C++ but until recently that would have been impossible. > I am actually using unity which use emscripten to build webgl. Would it > possible to use EM_ASM_PTR to write wasm code to return as pointer > (externref ? (an so I might return pointer as IntPtr in C#)) ? > > On Friday, 17 March 2023 at 22:35:55 UTC+7 tli...@google.com wrote: > >> Yes, but note that the usage in that commit is only in hand-written >> assembly code, not in C/C++. >> >> More recently, support for externref landed upstream in clang: >> https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/WebAssembly/wasm-externref.c. >> AFAIK we haven't yet experimented with it in Emscripten, but in principle >> it should work. >> >> On Fri, Mar 17, 2023 at 10:23 AM Thaina Yu <thai...@gmail.com> wrote: >> >>> Is this mean externref already usable? >>> >>> https://github.com/emscripten-core/emscripten/pull/15913 >>> >>> On Monday, 10 October 2022 at 22:56:34 UTC+7 karl.we...@gmail.com wrote: >>> >>>> Does anyone have news on this topic? >>>> >>>> tli...@google.com schrieb am Montag, 25. Januar 2021 um 19:51:36 UTC+1: >>>> >>>>> I don't think so, but you can keep an eye on commits from "wingo" and >>>>> "pmatos" on reviews.llvm.org to keep track of the progress. >>>>> >>>>> On Mon, Jan 25, 2021 at 12:55 AM ben layet <lay...@gmail.com> wrote: >>>>> >>>>>> Thanks! >>>>>> Is there a feature ticket in a publicly visible ticket tracker that I >>>>>> can keep an eye on? >>>>>> cheers >>>>>> ben >>>>>> >>>>>> On Saturday, 23 January 2021 at 17:54:25 UTC tli...@google.com wrote: >>>>>> >>>>>>> Not yet, but there are some folks working on this. Perhaps it will >>>>>>> be ready to use in a few months? It’s hard to say for sure. >>>>>>> >>>>>>> On Sat, Jan 23, 2021 at 03:49 ben layet <lay...@gmail.com> wrote: >>>>>>> >>>>>>>> Does emscripten support externref reference types for holding >>>>>>>> opaque handles to JS objects in C++? If not, any idea when? >>>>>>>> >>>>>>>> -- >>>>>>>> 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 emscripten-disc...@googlegroups.com. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/7f6178fa-bd05-4f65-aa7c-9e5a405bf851n%40googlegroups.com >>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/7f6178fa-bd05-4f65-aa7c-9e5a405bf851n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>> -- >>>>>> 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 emscripten-disc...@googlegroups.com. >>>>>> >>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/emscripten-discuss/68c9b121-f12f-44fa-a91c-2a8b73d2f456n%40googlegroups.com >>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/68c9b121-f12f-44fa-a91c-2a8b73d2f456n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- >>> 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 emscripten-disc...@googlegroups.com. >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/emscripten-discuss/57b1491a-7025-4967-a66e-ebcbf10f5e2bn%40googlegroups.com >>> <https://groups.google.com/d/msgid/emscripten-discuss/57b1491a-7025-4967-a66e-ebcbf10f5e2bn%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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 emscripten-discuss+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/ed80516b-e1ac-4ba1-a535-acd1f632a2f5n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/ed80516b-e1ac-4ba1-a535-acd1f632a2f5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29AAqZqJkYe_QnW1-1jhqNVk6qio8CnOgECnWGHPMTjSg%40mail.gmail.com.