PDA

View Full Version : Writing to an OpenGL Texture



pettersson
11-29-2009, 06:48 AM
Hi there,

Is it possible to directly write kernel output to an OpenGL texture? Looking at the Apple Samples (Noise Example to be specific) they write to a Buffer Object and copy it to an Image. So can i write to an OpenCL image object? I've created an image object and enqueued it via EnqueueAcquireGLObject. App doesn't crash, but doesn't work either :) Maybe i am missing something obvious. Maybe there even are examples of directly writing to an OpenGL texture?

Thx for any hints,
pettersson

dbs2
11-29-2009, 08:50 AM
There should be Apple examples for this. On the Apple platform you need to create a CL context from a GL context. You can then access GL textures from CL.

pettersson
11-29-2009, 01:53 PM
Hi,

i found the problem, actually it was a bug with my OpenGL code rather than OpenCL.

Thanks anyway,
pettersson