Sign in to follow this  
jpchristin

glCompressedTexImage2D with PBO

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this