Identifying which devices support gl_sharing

Started by paulbutcher, April 02, 2014, 08:40:36

Previous topic - Next topic

paulbutcher

I have a small app that uses gl_sharing. This runs fine on my MacBook Pro if I force it to use the NVIDIA GeForce GT 650M, but fails if I use the integrated Intel graphics. I assume that this is because the integrated graphics doesn't support gl_sharing (which is fine).

However, I've not found any way to programmatically determine that the NVIDIA supports gl_sharing. I assumed that I would be able to use CLDeviceCapabilities and look for one of CL_KHR_gl_sharing or CL_APPLE_gl_sharing, but neither of those flags is set :-(

This is what I get back for the Intel:

OpenCL 1.2 - Extensions: cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_gl_depth_images cl_khr_gl_event cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics

And this is what I get for the NVIDIA:

OpenCL 1.2 - Extensions: cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_fp64 cl_khr_gl_depth_images cl_khr_gl_event cl_khr_gl_msaa_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics

Right now, I've hard-coded the code to use the second device returned by getDevices, but that's hardly a good solution. Suggestions gratefully received for a better one.

Thanks in advance,

paul.butcher->msgCount++

spasi

Thanks, this should be fixed in the next nightly.

APPLE's OpenCL extensions are not converted to lower-case in the extension string, that's why LWJGL was failing to detect them. You should be able to see cl_APPLE_gl_sharing as available now.

paulbutcher

That's great - thanks!

Any idea when this might make its way into a release? I ask because this code is an example in a book:

http://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks

And I'd rather not ask my readers to download a nightly release if I can avoid it :-)

Many thanks!

paul.butcher->msgCount++