All,
I was wondering if anyone out there has successfully used Pixel Buffer Objects on the very latest ATI graphics card drivers. As best I can tell, every glTexSubImage call will fail. For instance, the following code shows the problem:
[b]GLuint pbo;
::glGenBuffers( 1, &pbo );
::glBindBuffer( GL_PIXEL_UNPACK_BUFFER, pbo );
::glBufferData( GL_PIXEL_UNPACK_BUFFER, 5125124, 0, GL_STREAM_DRAW );
::glBindBuffer( GL_PIXEL_UNPACK_BUFFER, 0 ); // Comment this line out and this code works !
GLuint tx;
::glGenTextures( 1, &tx );
::glBindTexture( GL_TEXTURE_2D, tx );
::glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL );
::glBindBuffer( GL_PIXEL_UNPACK_BUFFER, pbo );
::glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_BGRA, GL_UNSIGNED_BYTE, NULL );
assert( ::glGetError() == GL_NO_ERROR );[/b]
Indeed, if you look at the sample code “Streaming textures using pixel buffer objects” :
http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt
and then put a :
assert( glGetError() == GL_NO_ERROR );
after the SubTexSubImage call it will not succeed.
Am I going insane, or is something this basic really a problem ?
Andrew