Hello, i'm trying to use a openGL texture with openCL, but …
img = ComputeImage2D.CreateFromGLTexture2D(openCLContext, ComputeMemoryFlags.ReadWrite | ComputeMemoryFlags.UseHostPointer, (int)TextureTarget.Texture2D, 0, textureId);
produces an Image2D with the correct width and height, but depth equals 0.
Now i want to update this image by using:
commands.WriteToImage(bmp_data.Scan0, img, true, events);
My problem in this case is, that CreateFromGLTexture2D creates an image with depth = 0, but WriteToImage expects an image with depth = 1.
Is there any nice solution?
The CreateFromGLTextture2D returns depth=0, because interal the CL10.GetImageInfo with ComputeImageInfo.Depth is used. But the openCL-Standard defines the return value of this function on a 2DImage to zero. So in my opinion this function could not be used to get the depth of the texture.
You are right. This is a bug. I'll check the other methods (ReadFromImage might be also affected) and fix ASAP.
Thanks for catching this!
As a temporary workaround, you can use the ComputeCommandQueue.Write() method. That allows you to set up all the parameters by manually.
I pushed an update which should fix this issue. Can you test it, please?
Exactly the same code like in my local "workaround" ;)
Works fine, thx
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.