- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey guys... I have a problem with clCreateFromGLTexture2D.
The problem ist that I need to call the function twice to get a valid memory objects. Is this a bug... or did I missed to initialize something?!!?? Ive used the code with the NVidia SDK and there it works fine... currently just the CPU makes problems?!?! Any suggestions?!?!
SampleCode:
GLuint gl_texture_id;
GLenum target = GL_TEXTURE_2D;
cl_int l_Error;
// Create a texture in OpenGL and allocate space
glGenTextures(1, &gl_texture_id);
glBindTexture(target, gl_texture_id);
glTexImage2D(target, 0, GL_RGBA8, in_DisplacementTextureWidth, in_DisplacementTextureHeight, 0,
GL_RGBA, GL_FLOAT, NULL);
// Create first ref
cl_mem cl_image = clCreateFromGLTexture2D(m_ClContext.m_Context, CL_MEM_READ_WRITE,
GL_TEXTURE_2D, 0, gl_texture_id, &l_Error);
if (!cl_image || l_Error != CL_SUCCESS)
return false; // not valid
cl_image = clCreateFromGLTexture2D(m_ClContext.m_Context, CL_MEM_READ_WRITE,
GL_TEXTURE_2D, 0, gl_texture_id, &l_Error);
if (!cl_image || l_Error != CL_SUCCESS)
return false; // valid
The problem ist that I need to call the function twice to get a valid memory objects. Is this a bug... or did I missed to initialize something?!!?? Ive used the code with the NVidia SDK and there it works fine... currently just the CPU makes problems?!?! Any suggestions?!?!
SampleCode:
GLuint gl_texture_id;
GLenum target = GL_TEXTURE_2D;
cl_int l_Error;
// Create a texture in OpenGL and allocate space
glGenTextures(1, &gl_texture_id);
glBindTexture(target, gl_texture_id);
glTexImage2D(target, 0, GL_RGBA8, in_DisplacementTextureWidth, in_DisplacementTextureHeight, 0,
GL_RGBA, GL_FLOAT, NULL);
// Create first ref
cl_mem cl_image = clCreateFromGLTexture2D(m_ClContext.m_Context, CL_MEM_READ_WRITE,
GL_TEXTURE_2D, 0, gl_texture_id, &l_Error);
if (!cl_image || l_Error != CL_SUCCESS)
return false; // not valid
cl_image = clCreateFromGLTexture2D(m_ClContext.m_Context, CL_MEM_READ_WRITE,
GL_TEXTURE_2D, 0, gl_texture_id, &l_Error);
if (!cl_image || l_Error != CL_SUCCESS)
return false; // valid
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey,
Your code looks fine.
Could you provide small reproducer application? This will help us to understand the problem.
Thanks,
Evgeny
Your code looks fine.
Could you provide small reproducer application? This will help us to understand the problem.
Thanks,
Evgeny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After building a sample application I figured out what was wrong... stupid thing! I just was still including and linking the NVdia libs and includes instead the one of Intel OpenCl SDK. Change it and not it works smoothly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After testing a little bit I found a version that doesnt work with the IntelSDK - I created a sample and uploaded it. I would appreciate it if your team could take a look at it?!?! As far as I can say the context is valid... but the error message say something different.
Thanks in advance
http://www.file-upload.net/download-3585270/Tes3.rar.html
Thanks in advance
http://www.file-upload.net/download-3585270/Tes3.rar.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone even confirm that there is something wrong... maybe it depends only on my configuration or system!?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It looks like code is right.
Today we accpect CL_WGL_HDC_KHR to be defined.
We must also enable the default value 0.
Meanwhile please provide this property.
Thanks,
Evgeny
It looks like code is right.
Today we accpect CL_WGL_HDC_KHR to be defined.
We must also enable the default value 0.
Meanwhile please provide this property.
Thanks,
Evgeny

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page