summaryrefslogtreecommitdiffstats
path: root/balls.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-10-26 19:37:15 -0400
committerSam Anthony <sam@samanthony.xyz>2024-10-26 19:37:15 -0400
commitdd47d7c0d9a5d2c511988f92d0cf2be5ac5d1ba7 (patch)
treee327d11d1a2730b8b94864d0d318c76f645f7b86 /balls.c
parent9e9130f986217c1576b5cb1059bba92bb265e259 (diff)
downloadballs-dd47d7c0d9a5d2c511988f92d0cf2be5ac5d1ba7.zip
execKernel()
Diffstat (limited to 'balls.c')
-rw-r--r--balls.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/balls.c b/balls.c
index 486ab98..3365d4a 100644
--- a/balls.c
+++ b/balls.c
@@ -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