The reason AMD gets away with lower precision sin/cos is precisely because the specification lets them. Because the specification defines what the implementation can do. It is a matter of specification, not merely implementation. Therefore, you cannot rely on getting OpenCL-level precision from GLSL code. The point he’s making is that the OpenCL specification requires a certain level of precision that the GLSL specification does not. One again, the precision problem is in GLSL implementation. Sadly my GPU has only one of the two required extensions required to try this GL_ARB_sync is available but cl_khr_gl_event is not. GlWaitSync(cl_sync, 0, GL_TIMEOUT_IGNORED) GLsync cl_sync = glCreateSyncFromCLeventARB(context,release_event,0)
map OpenGL buffer object for writing from OpenCLĬlEnqueueAcquireGLObjects(cqCommandQue, 1, &vbo_cl, 0,&gl_event,NULL) ĬlEnqueueNDRangeKernel(cqCommandQue, ckKernel, 2, NULL, szGlobalWorkSize, NULL, 0,0,0 ) ĬlEnqueueReleaseGLObjects(cqCommandQue, 1, &vbo_cl, 0,0,&release_event)
Gl_event = clCreateEventFromGLSyncKHR(context,sync,NULL) GLsync sync = glFenceSync(GLSYNC_GPU_COMMANDS_COMPLETE, 0)
My pseudo code changes to above post are as follows (note untested) It requires two extensions GL_ARB_sync and cl_khr_event. On further reading (OpenCL Book by Munshi et al Chapter 10 pg 348-350 “Syncronization between OpenGL and OpenCL”), there is a code snippet to remove glFinish/clFinish.