When i use GL_TEXTURE_2D Array with glGenerateMipmaps and call glTexImage3D to generate an set of 2d texture array with automatic mipmaps. It never generate any of the mipmaps for the set of 2d textures. I did a test where i change the depth value of glTexImage3D then it generate the mipmap based on the depth which makes no sense. Have anyone ever run into this problem before. I though that each individual mipmaps could generate their own set of mipmaps and that it is not based of the depth.
This is how i am setting it up.
int bufferSize = w*h*numChannels*sizeofEachComponent*d;
unsigned char* arrayData = new unsigned char[bufferSize];
for(GLuint depthIndex = 0; depthIndex < pDesc->ArraySize; depthIndex++)
const void* currentResourceData = (pInitialData) ? pInitialData[depthIndex].pSysMem:NULL;
int oneLayer = w*h*numChannels*sizeofEachComponent;
unsigned char* memoryLocation = &arrayData[oneLayer*depthIndex];
So when i test the code in CodeXL it tells me there is no mipmpas generated for the glTexdImage3D, but when i set the depth to a different value than 1 then it generate mipmaps. It seems to me that for 3D textues mipmaps are generated based on depth which makes sense, but for Texture2D_ARRAY it does not.
Edited by BornToCode, 04 November 2013 - 09:34 AM.