title: OpenGL Texture 2D arrays and mipmapping
body: <p>I am trying to understand how to mipmap <a href="https://www.opengl.org/registry/specs/EXT/texture_array.txt" rel="nofollow">texture arrays</a> .From what I understand,texture array is 3 dimensional structure where each texture 2D has a depth param in glTexStorage3D which sets a given texture to some position in the array.But how do I specify number of mipmaps per texture?Can I specify different number of mipmaps per texture? </p>
  
  <p>Is this the right way to do it?</p>
  
  <pre><code>glTexStorage3D(GL_TEXTURE_2D_ARRAY,10,GL_RGBA8,width,height,numTextures);
  glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
  glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
  for(int i =0 ; i &lt;numTextures;++i){
  
      glTexSubImage3D(GL_TEXTURE_2D_ARRAY,/*What goes here???*/, 0, 0, 0, width, height, /*What goes here?*/, GL_RGBA, GL_UNSIGNED_BYTE, data);
  
   }
  
  glGenerateMipmap(GL_TEXTURE_2D_ARRAY); 
  </code></pre>
  
  <p>I don't know what to pass into second and 8 parameters of glTexSubImage3D. Should the second param be a number of mipmaps and the 8th - depth of the current texture?</p>