-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenGL/OpenCL interop texture render issues, and shared interop architecture abstraction could be improved. #1016
Comments
I just spotted that there were some old clCtxProps.put() statements that would make the clCtxProps incorrect. edit: removing the old clCtxProps code did not make any difference. is the opengl side synchronization missing a key? there are no frames, being show, not even some. just a black screen. edit: I added synchronization waiting to the opencl queue. no effect. the opencl program kernel seems not to be running. at all. edit: changing the argument image buffer to the opengl texture buffer results in clEnqueueNDRangeKernel error -52, ie invalid arguments. |
(why the memory buffer sharing interop is not using the normal buffer address kernel argument system?) edit: the opengl texture buffer is of the correct format, so whats up? and the opencl image long address is created successfully. edit: even the acquire and release globjects() function succeeds. only the kernel parameter setting and running fails. also the image buffer is the same pointer type that the previous int[] array was. always using the setkernelarg1p() function. edit: even specifically unbinding the created texture after creation and after a render pass, nothing happens. note: the lwjgl opengl interop opengl opencl demo works tho. so whats the issue. |
I'm not calling the acquire or release functions from the opengl thread. Would that break everything. Opencl is not thread locked. I moved all opengl and opencl buffer stuff to the main render loop/thread. now it crash-dumps on enqueuefillbuffer. just after enqueueacquireglobjects. no it actually crashes on waitforevents() function not on the fillbuffer() function. someone said the event stuff is different in gl and in cl. opencl kernel still not running. error is still -52 in the enqueuendrangekernel call. |
Well, opengl buffer sharing works, but the exact same code minus the buffer copy to texture, does not work. so whatever is going on with textures interop sharing from opengl is not working. |
as a side note, amd 5600g igpu failed to create shared device context, even if it advertised khr_sharing as capabilities. |
Question
What is missing in the code? the normal code works with int[] pixel buffed being loaded to the opengl texture (is base buffer rendering and display code is working), but when reimplemented to using the interop sharing mode between opencl and opengl, the final image is not showing up. I'm not implementing any other synchronization than CL10GL.clEnqueueAcquireGLObjects() and CL10GL.clEnqueueReleaseGLObjects() before and after the buffer write operations. CL10GL.clCreateFromGLTexture2D() function does not crash and returns a non-zero buffer long pointer.
Parts of the relevant java/opengl code:
opencl init code:
NOTE: instead of having to put the platform specific init code from the programmer side, it should be abstracted by the lwjgl side automatically. so that you dont have to deal with any platform specifics.
The text was updated successfully, but these errors were encountered: