I use glTexSubImage3D to update single voxels of a 3D texture, that is:
I have seen that one call to glTexSubImage3D will typically take 0.002 ms when the currently bound texture has dimensions 2x2x2.Code :glTexSubImage3D(GL_TEXTURE_3D, 0, x, y, z, //position 1, 1, 1, //w, h, d GL_COLOR_INDEX, GL_UNSIGNED_BYTE, voxval //unsigned char );
However, the time required for a single call to glTexSubImage3D seems to increase with increasing size of the currently bound texture. For instance, when the currently bound texture has dimensions 32x32x32, a single call to glTexSubImage3D takes 0.04 ms, - a factor 20 increase.
To me it seems peculiar that the execution time of glTexSubImage3D depends on the size of the currently bound texture. The call should perform a data transfer, and that should depend on the amount of data to transfer, and not the size of the target.
I have so far tested on two different Nvidia-cards, both on Linux-boxes, so I'm suspecting this might be a bug in the Nvidia driver.
Is there anyone here who knows any reason why glTexSubImage3D should depend on the size of the target texture?
Any feedback will be greatly appreciated!