Results 1 to 3 of 3

Thread: Read GL depth buffer from OpenCL?

  1. #1
    Junior Member
    Join Date
    Jun 2010

    Read GL depth buffer from OpenCL?

    I want to do some post-processing on a OpenGL depth buffer with OpenCL.

    However, AFAICT, OpenCL can't do this. Is this true? If so, what's the simplest way to shim this so OpenCL will work?


    clCreateFromGLTexture2D only honors cl_image_format formats, which are essentially only RGBA (color) formats. Any attempt to use a depth texture results in CL_INVALID_GL_OBJECT, even if you pass a GL_DEPTH_COMPONENT32F texture (component type GL_FLOAT, which is supported). So a depth texture is apparently out.

    And clCreateFromGLRenderbuffer says it "too" only handles RGBA-based (color) internal formats. Here's a guy that tried that last year and met with failure: link

    What's a poor developer to do?

  2. #2
    Senior Member
    Join Date
    May 2010
    Toronto, Canada

    Re: Read GL depth buffer from OpenCL?

    That's a good question. I'm not an expert on CL/GL interop, but as far as I understand you are out of luck. Sorry.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Jun 2010

    Re: Read GL depth buffer from OpenCL?

    Ok, thanks. I was hoping to get out of writing a redundant FLOAT color channel, doubling my write bandwidth, just to use OpenCL for this.

Similar Threads

  1. depth buffer
    By ditus in forum WebGL - General
    Replies: 4
    Last Post: 12-13-2012, 04:54 AM
  2. Writing to depth buffer
    By grillsnusk in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 08-27-2008, 03:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts