Hi,
I have some PBO/texture code that works on NVIDIA but not ATI. On NVIDIA, the scene looks like:
On ATI, it looks like the alignment is off:
This is using a 5400x2700 RGB texture. If I resize the texture to 2700x1350 or add an alpha component, it works on ATI. Perhaps this is related to a bug we discussed a while back: ATI: glTexImage2D with large texture doesn’t work.
Here is the code for each texture:
5400x2700 RGB (works on NVIDIA, artifacts on ATI)
glGenBuffers(1,&buffer);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,43740000,0,GL_STREAM_DRAW);
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB,0,43740000,data);
glGenTextures(1,&texture);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,0);
glBindTexture(GL_TEXTURE_2D,texture);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,5400,2700,0,GL_RGB,GL_UNSIGNED_BYTE,0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,5400,2700,GL_BGR,GL_UNSIGNED_BYTE,0);
glDeleteBuffers(1,&buffer);
2700x1350 RGB (works on both NVIDIA and ATI)
glGenBuffers(1,&buffer);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,10935000,0,GL_STREAM_DRAW);
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB,0,10935000,data);
glGenTextures(1,&texture);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,0);
glBindTexture(GL_TEXTURE_2D,texture);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,2700,1350,0,GL_RGB,GL_UNSIGNED_BYTE,0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,2700,1350,GL_BGR,GL_UNSIGNED_BYTE,0);
glDeleteBuffers(1,&buffer);
5400x2700 RGBA (works on both NVIDIA and ATI)
glGenBuffers(1,&buffer);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,58320000,0,GL_STREAM_DRAW);
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB,0,58320000,data);
glGenTextures(1,&texture);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,0);
glBindTexture(GL_TEXTURE_2D,texture);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,5400,2700,0,GL_RGB,GL_UNSIGNED_BYTE,0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,buffer);
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,5400,2700,GL_BGRA,GL_UNSIGNED_BYTE,0);
glDeleteBuffers(1,&buffer);
Here are the textures:
[ul][li]5400x2700 RGB: world.topo.200412.3x5400x2700.jpg[]2700x1350 RGB: world.topo.200412.3x2700x1350.jpg[]5400x2700 RGBA: world.topo.200412.4x5400x2700.png[*] Original source: NASA Visible Earth[/ul][/li]I thought this could have something to do with my call to glPixelStorei, but I verified the data is indeed 4 byte aligned.
I tested using a Radeon HD 5870 with Catalyst 10.11 on Vista 64.
Thanks,
Patrick