diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-10-26 19:37:15 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-10-26 19:37:15 -0400 |
| commit | dd47d7c0d9a5d2c511988f92d0cf2be5ac5d1ba7 (patch) | |
| tree | e327d11d1a2730b8b94864d0d318c76f645f7b86 | |
| parent | 9e9130f986217c1576b5cb1059bba92bb265e259 (diff) | |
| download | balls-dd47d7c0d9a5d2c511988f92d0cf2be5ac5d1ba7.zip | |
execKernel()
| -rw-r--r-- | balls.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -205,7 +205,26 @@ configureSharedData(void) { void execKernel(void) { - // TODO + int err; + cl_event kernelEvent; + + glFinish(); + + err = clEnqueueAcquireGLObjects(queue, nelem(memObjs), memObjs, 0, NULL, NULL); + if (err < 0) + sysfatal("Couldn't acquire the GL objects.\n"); + + err = clEnqueueTask(queue, kernel, 0, NULL, &kernelEvent); + if (err < 0) + sysfatal("Couldn't enqueue the kernel.\n"); + + err = clWaitForEvents(1, &kernelEvent); + if (err < 0) + sysfatal("Couldn't enqueue the kernel.\n"); + + clEnqueueReleaseGLObjects(queue, nelem(memObjs), memObjs, 0, NULL, NULL); + clFinish(queue); + clReleaseEvent(kernelEvent); } void |