Jump to content
  • Advertisement
Sign in to follow this  

Upload mipmap texture using PBO ...

This topic is 3783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm using PBO to upload mipmap 2D texture array to GPU. For my convenience (less time consuming in my algorithm), i'd like to upload my textures as follow : forall zOffset {   forall mipmapLevel {     int Size = width*height*3;     GLfloat* mytex = new GLfloat[Size];     initTexture(mytex,mipmapLevel,zOffset);     glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, aBuf );     glBufferData( GL_PIXEL_UNPACK_BUFFER_ARB,       Size*sizeof(float), NULL,       GL_STREAM_DRAW );     void* pbomem = glMapBuffer( GL_PIXEL_UNPACK_BUFFER_ARB,       GL_WRITE_ONLY );     memcpy( pbomem, mytex, Size*sizeof(float) );     glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);     glTexSubImage3D( GL_TEXTURE_2D_ARRAY_EXT,       mipmapLevel, 0, 0, zOffset,       width, height, 1,       GL_RGB, GL_FLOAT, 0);     glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );   } } However, it is not possible to use PBO as is ... So, just change the loop with : forall mipmapLevel {   forall zOffset {     ...   } } and it works fine ! So, i'd like to know if it is possible to upload as in the first version : loop on zOffset then loop on mipmap. Maybe PBO on mipmap sequentially is avoid ! I execute my code on 8800GTX with lastest linux driver. If someone have any idea ? Thanks a lot ! -- djedge

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!