Malte Clasen
04-26-2007, 05:02 PM
Hi,
I'm currently trying to use pixel buffer objects to accelerate texture updates. The code looks as follows:
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, mPBO);
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size, imageBuffer, GL_STREAM_DRAW);
glTexSubImage2D(
GL_TEXTURE_2D, 0,
regionPos[0], regionPos[1],
regionSize[0], regionSize[1],
mFormat,
mType,
0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
This works fine as long as regionPos/regionSize cover the whole texture. If it's only a partial update, the texture content is mixed up afterwards (I still have to investigate on this). If I just pass the buffer to glTexSubImage2D, partial updates work fine. Is there some kind of limitation for PBOs and partial texture updates?
I'm using a NVidia Geforce 7900GT, Windows XP x64, 97.92 drivers.
Best regards,
Malte
I'm currently trying to use pixel buffer objects to accelerate texture updates. The code looks as follows:
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, mPBO);
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size, imageBuffer, GL_STREAM_DRAW);
glTexSubImage2D(
GL_TEXTURE_2D, 0,
regionPos[0], regionPos[1],
regionSize[0], regionSize[1],
mFormat,
mType,
0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
This works fine as long as regionPos/regionSize cover the whole texture. If it's only a partial update, the texture content is mixed up afterwards (I still have to investigate on this). If I just pass the buffer to glTexSubImage2D, partial updates work fine. Is there some kind of limitation for PBOs and partial texture updates?
I'm using a NVidia Geforce 7900GT, Windows XP x64, 97.92 drivers.
Best regards,
Malte