taichi icon indicating copy to clipboard operation
taichi copied to clipboard

Android Aot Opengl

Open helloworldstone opened this issue 2 years ago • 7 comments

hi, everyone! I'm planning to use taichi on Android with aot.

I find a demo with vulkan from here: https://github.com/taichi-dev/taichi-aot-demo/blob/master/implicit_fem/include/fem_app.h.

Now I want to use aot with opengl. First, I use "mod = ti.aot.Module(ti.opengl)" to generate an glsl file. But how to use this glsl file in C++? Do I need to create taichi::lang::gfx::GfxRuntime?

I am confused for a few days. Can someone help me? It is better to provide an example.

Thanks a million!

helloworldstone avatar Aug 04 '22 13:08 helloworldstone

@helloworldstone Our implicit_fem demo is based on vulkan runtime and opengl support is on our todo list but we're still working on it.

Is vulkan backend sufficient for your android use case btw? If gles is a hard requirement, you might need wait for C++ gles support to be available or manually writing a small runtime for taichi opengl kernels, an example can be found at https://github.com/taichi-dev/taichi-aot-demo/tree/master/nbody_ndarray/java_runtime,

ailzhang avatar Aug 05 '22 00:08 ailzhang

@ailzhang Thanks for your reply! Btw which version will you support C++ gles ? v1.0.5 or later versions?

helloworldstone avatar Aug 05 '22 10:08 helloworldstone

We'll likely support GLES 3.1, since that's the one supporting Compute Shaders. Which 1.05 version are you referring to?

k-ye avatar Aug 07 '22 09:08 k-ye

@k-ye Thank you! v1.0.5 refers to taichi version. Which taichi version will you support c++ gles pipeline api? https://github.com/taichi-dev/taichi/releases

helloworldstone avatar Aug 08 '22 02:08 helloworldstone

Ah I see, ha ha. There's no immediate timeline for this, but to shed some light, the dev team's already looking into GL support. We will ping this thread to give you an update :-)

k-ye avatar Aug 08 '22 03:08 k-ye

@helloworldstone We'll be releasing v1.1.0 in a few days but this feature won't be available before that. We can let you know as soon as it's available in a nightly version for you to try it out, does this sound good?

ailzhang avatar Aug 08 '22 03:08 ailzhang

@ailzhang @k-ye Thank you both! I will try it when it‘s available. Looking forward to your good news!:-)

helloworldstone avatar Aug 08 '22 08:08 helloworldstone