Image2D openGL/CL Interop problem

Help
basti
2011-01-15
2012-12-21
  • basti

    basti - 2011-01-15

    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?

     
  • basti

    basti - 2011-01-15

    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.

     
  • nythrix

    nythrix - 2011-01-15

    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!

     
  • nythrix

    nythrix - 2011-01-15

    As a temporary workaround, you can use the ComputeCommandQueue.Write() method. That allows you to set up all the parameters by manually.

     
  • nythrix

    nythrix - 2011-01-17

    I pushed an update which should fix this issue. Can you test it, please?

     
  • basti

    basti - 2011-01-18

    Exactly the same code like in my local "workaround" ;)
    Works fine, thx

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks