- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
Lien copié
5 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Can someone even confirm that there is something wrong... maybe it depends only on my configuration or system!?!
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable