Fast loading of large 3D textures

I have been trying to make use of nVidias pixel_data_range(PDA) and pixel_buffer_object, as described in the examples at the end of

to speed up 3D texture loading.

Uploading a 16MB texture (256x256x256x8bit) using glTexSubImage3D with no extensions gives a framerate of 1.5frames/sec, while using the PDR extension gives a framerate of 0.5.

The data I am trying to load are pure intensity data (medical images) ,using GL_LUMINANCE or GL_LUMINANCE_ALPHA, but I have tried a number of different internalformat/format combinations to make texture loading work faster, but no luck so far. (I understand that data stored as unsigned bytes on the BGRA format, is the best candidate for speedup)

Any help on how to speed up texture loading will be appreciated.

Dag Magne

Are you aware that your texture may be 64 MB in internal video ram? IIRC, Nvidia up until the NV40 has no internal “luminance” or “alpha-only” format, so it gets converted to RGBA eventually.

I see that converting luminance data to rgba may be both time and space consuming. What I don’t understand is why glTexSubImage without any extensions gives the highest framerate.

Both PDR and PBO give access to memory on the graphics card so that data can be moved using memcpy, and this appears to be fast. But when glTexSubImage is called to move data internaly on the graphics card it takes longer than an ordinary glTexSubImage call. It is my understanding that glTexSubImage using PDR or PBO should return immediately, and that data should be moved asynchron using DMA. This seems not to work in my setup.

Dag Magne

If the data needs to be read back to be converted by the driver, and the pixel data range memory is un-cached, then the read-back for conversion is slower in the PDR case.