Re: fastest OpenGL/OpenCL interop in an FCPX plugin?
Re: fastest OpenGL/OpenCL interop in an FCPX plugin?
- Subject: Re: fastest OpenGL/OpenCL interop in an FCPX plugin?
- From: Garrick Meeker <email@hidden>
- Date: Fri, 08 Nov 2013 09:21:04 -0800
Take a look at cl_khr_gl_event (specifically clCreateEventFromGLsyncKHR) which was added in CL 1.1. The docs may be a little confusing but they refer to non-portable synchronization when cl_khr_gl_event is not available. Basically you create a GLsync from OpenGL which isn’t blocking, call clCreateEventFromGLsyncKHR to create a cl_event and make sure clEnqueueAcquireGLObjects and others wait on the right events.
See the docs for clEnqueueReleaseGLObjects. If cl_khr_gl_event is enabled the GL commands that affect that buffer won’t take affect until the CL commands complete (although you should determine if that allows you to avoid clFinish.) You probably want to call clFinish anyway so you can release your temporary buffers before returning from the plugin.
There is also GL_ARB_cl_event to go from CL to GL, but that may not be useful unless you do GL drawing as well (since you need to clFinish before releasing buffers anyway).
On Nov 8, 2013, at 8:36 AM, Paul Miller <email@hidden> wrote:
> So far my GL/CL interop is working pretty well, but I'm wondering if there are any tricks I can safely play within FCPX?
>
> Right now I've got the standard glFinish() before the enqueue of the binding to the GL textures, then the final clFinish() after the enqueue of the unbind.
>
> Is there anything I can safely skip in there?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Pro-apps-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden