Jump to content
  • Advertisement
Sign in to follow this  
jpchristin

glCompressedTexImage2D with PBO

This topic is 3812 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

Hi, Does anyone here have ever use glCompressedTexImage2D with PBO ?!?! If yes, how are the performances compared to glCompressedTexImage2D without PBO? ------------------------------------ So if I use: --------------- glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, unBuf ); glBufferData( GL_PIXEL_UNPACK_BUFFER_ARB, nSize, NULL, GL_STREAM_DRAW ); void* ioMem = glMapBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY ); memcpy( ioMem, a_pData, nSize ); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB); glCompressedTexImage2DARB( GL_TEXTURE_2D, a_nLevel, internalformat, a_nUDim, a_nVDim, bordersize, nSize, NULL ); glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, 0 ); --------------- it is way slower then using: --------------- glCompressedTexImage2D( GL_TEXTURE_2D, a_nLevel,internalformal, a_nUDim,a_nVDim,bodersize, nSize, a_pData ); --------------- Thanks, J-P

Share this post


Link to post
Share on other sites
Advertisement
The execution speed is entirely dependent on how you use it.

The opengl documentation states that a call to glTexImage2D/glCompressedTexImage2D
will block until the source data is uploaded. However, if a pixel buffer object is bound it will return immediately and the data will be transferred to the texture object by the driver/hardware.

Share this post


Link to post
Share on other sites
Thanks,

I have found that if I use glTexImage2D with an internal format dxt, it is much faster then using glCompressedTexImage2D.

Share this post


Link to post
Share on other sites
Quote:
Original post by jpchristin
I have found that if I use glTexImage2D with an internal format dxt, it is much faster then using glCompressedTexImage2D.


That is odd. I thought the idea was that the driver can upload glCompressed* directly whereas it performs the compression with glTexImage(someCompressedInternalFormat). How do you benchmark it? I guess you're absolutely sure your implementation doesn't fall back to some uncompressed format even though you specify DXT/BC? Maybe check with glGetTexLevelParameter (using pname GL_TEXTURE_COMPRESSED)?

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!