I want to use to PBOs as textures and put them in two separate texture units (TEXUNIT0 and TEXUNIT1) for input to a shader.
I made some tests and it seems that all the units are set to the latest PBO I bound.
I checked the GL_ARB_pixel_buffer_object specification and didn’t see anything regarding multitexturing. No luck with google too.
I am using a GeForce 7800GS on Windows XP with 93.50 (intrumented) drivers.
I think you have the wrong idea about PBOs, because you don’t bind a PBO to a texture unit.
PBO only provide a new data source for pixel data (ie, for texture creation), but beyond creation, they don’t change how the texture is used. They are entirely orthoginal to multitexturing.
In your code, assuming the texture storage was already specified via glTexImage2D(), should be just fine.
I may have simplified my explanation too much but I wanted to get to the point.
What I meant is really setting the pbo as source for the textures bound to the texture units.
Without PBOs (using texture IDs) it works fine, with PBOs it just doesn’t.
I’ve used PBOs quite some time but never got to multitexturing with them before.
The code I provided is only to update the pbos in my render loop (GL_DYNAMIC_DRAW).
Yes PBOs and multitexturing are orthogonal but PBO seem to change a thing: glBindTexture and glGenTextures don’t seem to be needed for single texturing. This may be the source of my problem.
Alright it seems that glGenTextures and glBindTexture are needed.
The driver shouldn’t allow it to work without them but it does in single texturing. A GL_INVALID_OPERATION error or at least a black result would have been nice.