<?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 problem with PBO in Graphics</title>
    <link>https://community.intel.com/t5/Graphics/problem-with-PBO/m-p/277464#M8415</link>
    <description>&lt;P&gt;I am having problem with using pixel buffer object for uploading data to textures . My code works fine in ATI machine but doesn't work in machine having&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Renderer Name     Intel(R) HD Graphics FamilyRenderer Version     3.0.0 - Build 8.15.10.2321Renderer Type     Installable client &lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to know whether there are some known issues related to this driver or my i m doing something wrong in my code . Please see the code snippet below . I checked before posting and gl_arb_pixel_buffer_object extension was available , and the glTexSubImage2d call was giving error GL_INVALID_OPERATION .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;GLuint InitializeTexturePBO(CPUInt16 bufferSize)
{
     GLuint pbo;
     (*m_glGenBuffersARB)(1,&amp;amp;pbo);
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
     (*m_glBufferDataARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 
          bufferSize , NULL , GL_STREAM_DRAW_ARB);
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
     return pbo;
}
void* GetPBOBufferPointer(unsigned int identifier ,int width , int height)
{
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, identifier );
     (*m_glBufferDataARB)(GL_PIXEL_UNPACK_BUFFER_ARB, width*height*4 ,
      0, GL_STREAM_DRAW_ARB);
     return (void*)(*m_glMapBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB,
     GL_WRITE_ONLY_ARB);
}


void UnmapPBOBuffer()
{
     if(!m_glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB))
                 throw CustomException();
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
     
}
 
&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call them in this order -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;InitializeTexturePBO(); // removed the arguments
GetPBOBufferPointer(); // take this pointer and decode video frames at this location
glBindTexture(GL_TEXTURE_2D , textureObjectList[sourceID]);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,ToInt16(m_videoSourceInfos[sourceID]-&amp;gt;m_sourceParams.m_videoDimensions.m_width),
ToInt16(m_videoSourceInfos[sourceID]-&amp;gt;m_sourceParams.m_videoDimensions.m_height),GL_BGRA_EXT,GL_UNSIGNED_BYTE,
0);
UnmapPBOBuffer(); &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2011 11:21:31 GMT</pubDate>
    <dc:creator>idata</dc:creator>
    <dc:date>2011-11-08T11:21:31Z</dc:date>
    <item>
      <title>problem with PBO</title>
      <link>https://community.intel.com/t5/Graphics/problem-with-PBO/m-p/277464#M8415</link>
      <description>&lt;P&gt;I am having problem with using pixel buffer object for uploading data to textures . My code works fine in ATI machine but doesn't work in machine having&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Renderer Name     Intel(R) HD Graphics FamilyRenderer Version     3.0.0 - Build 8.15.10.2321Renderer Type     Installable client &lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to know whether there are some known issues related to this driver or my i m doing something wrong in my code . Please see the code snippet below . I checked before posting and gl_arb_pixel_buffer_object extension was available , and the glTexSubImage2d call was giving error GL_INVALID_OPERATION .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;GLuint InitializeTexturePBO(CPUInt16 bufferSize)
{
     GLuint pbo;
     (*m_glGenBuffersARB)(1,&amp;amp;pbo);
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
     (*m_glBufferDataARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 
          bufferSize , NULL , GL_STREAM_DRAW_ARB);
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
     return pbo;
}
void* GetPBOBufferPointer(unsigned int identifier ,int width , int height)
{
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, identifier );
     (*m_glBufferDataARB)(GL_PIXEL_UNPACK_BUFFER_ARB, width*height*4 ,
      0, GL_STREAM_DRAW_ARB);
     return (void*)(*m_glMapBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB,
     GL_WRITE_ONLY_ARB);
}


void UnmapPBOBuffer()
{
     if(!m_glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB))
                 throw CustomException();
     (*m_glBindBufferARB)(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
     
}
 
&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call them in this order -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;InitializeTexturePBO(); // removed the arguments
GetPBOBufferPointer(); // take this pointer and decode video frames at this location
glBindTexture(GL_TEXTURE_2D , textureObjectList[sourceID]);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,ToInt16(m_videoSourceInfos[sourceID]-&amp;gt;m_sourceParams.m_videoDimensions.m_width),
ToInt16(m_videoSourceInfos[sourceID]-&amp;gt;m_sourceParams.m_videoDimensions.m_height),GL_BGRA_EXT,GL_UNSIGNED_BYTE,
0);
UnmapPBOBuffer(); &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 11:21:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/problem-with-PBO/m-p/277464#M8415</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2011-11-08T11:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem with PBO</title>
      <link>https://community.intel.com/t5/Graphics/problem-with-PBO/m-p/277465#M8416</link>
      <description>&lt;P&gt;Perhaps you could try to unmap the buffer before using the buffer data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what the OpenGL Reference says about glMapBuffer / glUnmapBuffer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"... A mapped data store must be unmapped with glUnmapBuffer before its buffer&lt;/P&gt;&lt;P&gt;object is used. Otherwise an error will be generated by any GL command that&lt;/P&gt;&lt;P&gt;attempts to dereference the buffer object´s data store. ..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the code snippet you provided it seems like you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. call your function GetPBOBufferPointer which maps the buffer&lt;/P&gt;&lt;P&gt;2. write some data to the buffer&lt;/P&gt;&lt;P&gt;3. bind your texture,&lt;/P&gt;&lt;P&gt;4. call glTexSubImage2D&lt;/P&gt;&lt;P&gt;5. and only then unmap and "unbind" the buffer object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you could try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. call your function GetPBOBufferPointer which maps the buffer&lt;/P&gt;&lt;P&gt;2. write some data to the buffer&lt;/P&gt;&lt;P&gt;3. unmap the buffer&lt;/P&gt;&lt;P&gt;4. bind your texture&lt;/P&gt;&lt;P&gt;5. call glTexSubImage2D&lt;/P&gt;&lt;P&gt;6. and then "unbind" the buffer object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I haven´t used PBOs myself, I could as well be completely off here.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2011 13:18:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/problem-with-PBO/m-p/277465#M8416</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2011-11-09T13:18:54Z</dc:date>
    </item>
  </channel>
</rss>

