ugluk
10-09-2010, 06:48 PM
Say I have 16 texture units, each bound with a distinct texture object. Now a texture object has a GLuint handle, that's at least 32-bits on most systems. How the heck do I place all those GLuints into a key according to which I then sort the batches? I'd understand, if I were to simply pack the GLuints into a, say, 64-bit integer, but 16*4*8=512. One idea:
first sort according to first texture object,
then sort the sets from the first step according to the second texture object
...
This would make for many sorts, so there must be a better way. I could also use a BigInteger (say, from the gmp library) class, but that would probably result in horrible slowness. Please, share some nice idea on how to do it.
first sort according to first texture object,
then sort the sets from the first step according to the second texture object
...
This would make for many sorts, so there must be a better way. I could also use a BigInteger (say, from the gmp library) class, but that would probably result in horrible slowness. Please, share some nice idea on how to do it.