I’m developing an application that uses OpenGL-OpenCL interoperability feature. I render to a GL_TEXTURE_2D_ARRAY using geometry shader and then uses OpenCL to process the texture array.
The issue I’m facing is that, I originally used Geforce GTS 250 graphics card and it works fine, the OpenCL kernel can access the texture array as image3d_t passed in as argument. I’ve upgraded my graphics card to Geforce GTX 550 Ti and even though the buffer creation (using clCreateFromGLTexture3D()) and call to clEnqueueNDRangeKernel() return CL_SUCCESS, when I call clFinish() after the kernel execution the returned value is CL_INVALID_COMMAND_QUEUE (-36).
The issue seems to be with the z-component of the texture coordinate being passed into the read_imagef() function. If I put 0 to access the first layer it doesn’t complain, but if I put anything greater than 0, it returns the CL_INVALID_COMMAND_QUEUE.
If I used GL_TEXTURE_3D instead of GL_TEXTURE_2D_ARRAY, OpenCL can access the buffer just fine, but I need to attach a depth buffer to the texture array and I don’t think I can do that with GL_TEXTURE_3D.
I’m using the developer driver 270.81, OpenGL 3.3 and OpenCL 1.0 for both graphics card.
The only difference I can think of between the two graphics cards are the architecture and the compute capability. But I’m not sure if those are what causing the issue.
Does anyone have any experience working with 3D texture in OpenCL? Is GL_TEXTURE_2D_ARRAY meant to be supported in OpenCL?
I’ve asked this question on the NVIDIA Developer forums and Khronos OpenCL forum as well, but I thought there’s a lot more people here. Trying to increase the chance of resolving this issue ^^;
According to the OpenCL specification 1.1 there’s no mention of it supporting GL_TEXTURE_2D_ARRAY.
Would anyone be able to help me by testing it on graphics card with Compute Capability of 1.3 and 2.0? So far I’ve tried it on GTS 250 and 8600M GT (Compute Capability 1.1 - both seems to work) and on GTX 550 Ti (Compute Capability 2.1). (I’ll try to attach a test program sometime today for anyone who can help) Or if anyone has any suggestion on other ways of rendering to texture array/3D texture to be processed by OpenCL, I’d really appreciate it.
Thank you in advance.