<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CL-GL-Interop: clEnqueueAcquireGLObjects fails! in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-GL-Interop-clEnqueueAcquireGLObjects-fails/m-p/819994#M1065</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to set up a CL-GL project.&lt;BR /&gt;Everything works fine up to the point where I want to use the GL-Buffer within CL.&lt;BR /&gt;&lt;BR /&gt;Is this an issue with my code or with sys system specs?&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;System:&lt;BR /&gt;i5-2500 CPU (OpenCL 1.1 (Build 30316.30328))&lt;BR /&gt;Integrated Intel HD2000 Graphics (OpenGL 3.1.0 - Build 8.15.10.2696)&lt;BR /&gt;&lt;BR /&gt;What I did:&lt;BR /&gt;[cpp]//GL is set-up and is running

//CL is set-up with CL_GL_CONTEXT_KHR and CL_WGL_HDC_KHR and is running&lt;BR /&gt;//Context: CL_DEVICE_TYPE_CPU&lt;BR /&gt;&lt;BR /&gt;//Loaded Texture with
glGenTextures(1, &amp;amp;texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
//Texture is successfully rended on Screen!

//Created CL-Image with
cl::Image2DGL imageIn(context, CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, texture);
//Success!!

//Using Texture in CL with
glFlush();
glFinish();
VECTOR_CLASS&lt;:MEMORY&gt; mem_objects(1);
mem_objects.push_back(imageIn);
queue.enqueueAcquireGLObjects(&amp;amp;mem_objects, NULL, &amp;amp;event);
//FAILS WITH: -38 CL_INVALID_MEM_OBJECT&lt;BR /&gt;&lt;BR /&gt;//glGetError() returns 0 at any point of this code![/cpp]&lt;/:MEMORY&gt;</description>
    <pubDate>Fri, 18 May 2012 09:13:21 GMT</pubDate>
    <dc:creator>nippey</dc:creator>
    <dc:date>2012-05-18T09:13:21Z</dc:date>
    <item>
      <title>CL-GL-Interop: clEnqueueAcquireGLObjects fails!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-GL-Interop-clEnqueueAcquireGLObjects-fails/m-p/819994#M1065</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to set up a CL-GL project.&lt;BR /&gt;Everything works fine up to the point where I want to use the GL-Buffer within CL.&lt;BR /&gt;&lt;BR /&gt;Is this an issue with my code or with sys system specs?&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;System:&lt;BR /&gt;i5-2500 CPU (OpenCL 1.1 (Build 30316.30328))&lt;BR /&gt;Integrated Intel HD2000 Graphics (OpenGL 3.1.0 - Build 8.15.10.2696)&lt;BR /&gt;&lt;BR /&gt;What I did:&lt;BR /&gt;[cpp]//GL is set-up and is running

//CL is set-up with CL_GL_CONTEXT_KHR and CL_WGL_HDC_KHR and is running&lt;BR /&gt;//Context: CL_DEVICE_TYPE_CPU&lt;BR /&gt;&lt;BR /&gt;//Loaded Texture with
glGenTextures(1, &amp;amp;texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
//Texture is successfully rended on Screen!

//Created CL-Image with
cl::Image2DGL imageIn(context, CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, texture);
//Success!!

//Using Texture in CL with
glFlush();
glFinish();
VECTOR_CLASS&lt;:MEMORY&gt; mem_objects(1);
mem_objects.push_back(imageIn);
queue.enqueueAcquireGLObjects(&amp;amp;mem_objects, NULL, &amp;amp;event);
//FAILS WITH: -38 CL_INVALID_MEM_OBJECT&lt;BR /&gt;&lt;BR /&gt;//glGetError() returns 0 at any point of this code![/cpp]&lt;/:MEMORY&gt;</description>
      <pubDate>Fri, 18 May 2012 09:13:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/CL-GL-Interop-clEnqueueAcquireGLObjects-fails/m-p/819994#M1065</guid>
      <dc:creator>nippey</dc:creator>
      <dc:date>2012-05-18T09:13:21Z</dc:date>
    </item>
    <item>
      <title>CL-GL-Interop: clEnqueueAcquireGLObjects fails!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-GL-Interop-clEnqueueAcquireGLObjects-fails/m-p/819995#M1066</link>
      <description>It works now:&lt;BR /&gt;&lt;BR /&gt;[cpp]//With these already *successfully* initialised variables
cl::CommandQueue queue(context, devices[0], 0, &amp;amp;err);
cl::Image2DGL imageIn(context, CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, texture);

//Doing the following works now
VECTOR_CLASS&lt;:MEMORY&gt;* mem_objects = new VECTOR_CLASS&lt;:MEMORY&gt;(); 
mem_objects-&amp;gt;push_back(imageIn);
queue.enqueueAcquireGLObjects(mem_objects);[/cpp] Maybe it might help someone else ;)&lt;/:MEMORY&gt;&lt;/:MEMORY&gt;</description>
      <pubDate>Mon, 21 May 2012 06:57:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/CL-GL-Interop-clEnqueueAcquireGLObjects-fails/m-p/819995#M1066</guid>
      <dc:creator>nippey</dc:creator>
      <dc:date>2012-05-21T06:57:59Z</dc:date>
    </item>
  </channel>
</rss>

