Jump to content
  • Advertisement
Sign in to follow this  
giugio

OpenGL qt and opengl/cl interop

This topic is 2033 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

h?llo.
I'm trying to use an interop with opengl and opencl in qt.
this is my code:

    GLuint id = 0;
    glGenBuffers(1, &id);
    glBindBuffer(GL_ARRAY_BUFFER, id);
    glBufferData(GL_ARRAY_BUFFER, lSize, NULL, GL_STATIC_DRAW);

    int err;
    cl::BufferGL buff;
    buff= cl::BufferGL(context, CL_MEM_WRITE_ONLY, id, &err);
    
    glBindBuffer(GL_ARRAY_BUFFER, 0);
    vertexBufferObject = id;

I get always the same error:
-60: CL_INVALID_GL_OBJECT.
i omitted the construction of the gl/cl context code, but I'm was try this without qt and all works fine.
When i use the code in qt i get the error.
What can be?
the threads and contexts that are used in qt?
How i can resolve?
But I wish understand and use my own library, rather than use an already done library .
thanks.

 

Share this post


Link to post
Share on other sites
Advertisement

hi,

 

I've only encountered this on linux, with amd catalyst drivers. Basically reinstalling the driver (without uninstalling it first!!) using forced settings solved it.

Other than that it can only happen if the GL object passed is not a valid gl object (ie. you didn't set up the gl object properly).

 

the only other thing that I can think of is that qt sets up the opengl context differently. So you probably have to dig into that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!