1

I'm using PBO as follows:

glGenBuffersARB(1, &pboIds);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pboIds);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, FB_SIZE, 0, GL_DYNAMIC_DRAW_ARB);
unsigned char* ptr = (unsigned char*)glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
memcpy(ptr, g_fb_addr, FB_SIZE);
glBindTexture(GL_TEXTURE_2D, textureId);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, FB_WIDTH, FB_HEIGHT, FB_FORMAT, GL_UNSIGNED_BYTE, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);

And, I'm using textureId to be displayed on screen. BTW, g_fb_addr, which is the source of image has tiled memory layout. So the displayed image is striped in horizontal axis.

My question is, is there a way to upload a tiled image into PBO?

jaeyong
  • 8,951
  • 14
  • 50
  • 63
  • What is the question supposed to mean? You can upload arbitrary data to a PBO. There is no reason why you couldn't use PBOs with tiles of larger images. – derhass Jan 16 '15 at 23:41

0 Answers0