ebitengine / purego

Apache License 2.0
1.94k stars 63 forks source link

question about OpenCL #215

Closed MatejMagat305 closed 4 months ago

MatejMagat305 commented 4 months ago

I am only asking, could be theoretically possible use purego to opencl.so? And , could be theoretically possible use purego on android f. e. to opencl.so? as https://github.com/krrishnarraj/libopencl-stub ...., and last question is: could it accept int to typedef int cl_GLint; or cl_int?

TotallyGamerJet commented 4 months ago

I am only asking, could be theoretically possible use purego to opencl.so?

Yes, it can open any .so

And , could be theoretically possible use purego on android f. e. to opencl.so? as https://github.com/krrishnarraj/libopencl-stub ....,

Most likely but it isn't actively tested. Android is just Linux after all

and last question is: could it accept int to typedef int cl_GLint; or cl_int?

Go's int is most likely bigger than C's int so it's not correct. You probably want this:

type GLint int32

Making sure the sizes are the same is important and purego can't verify that it's correct.

Also, for future questions please post in the Discord linked in the README

MatejMagat305 commented 4 months ago

I am only asking, could be theoretically possible use purego to opencl.so?

Yes, it can open any .so

And , could be theoretically possible use purego on android f. e. to opencl.so? as https://github.com/krrishnarraj/libopencl-stub ....,

Most likely but it isn't actively tested. Android is just Linux after all

and last question is: could it accept int to typedef int cl_GLint; or cl_int?

Go's int is most likely bigger than C's int so it's not correct. You probably want this:

type GLint int32

Making sure the sizes are the same is important and purego can't verify that it's correct.

Also, for future questions please post in the Discord linked in the README

thank(I go to try it...), I am sorry, but discord seems like that: discord