texture arrays mipmapping

Hello,
Since mipmapping in texture arrays doesn’t reduce the number of layers (or pages) I guess I could reuse this function:

void Texture::
filter_3d_mipmap_level(Texture::RamImage &to, const Texture::RamImage &from,
                       int x_size, int y_size, int z_size) {
  size_t pixel_size = _num_components * _component_width;
  size_t row_size = (size_t)x_size * pixel_size;
  size_t page_size = (size_t)y_size * row_size;

  int to_x_size = max(x_size >> 1, 1);
  int to_y_size = max(y_size >> 1, 1);
  int to_z_size = max(z_size >> 1, 1);
...
  for (z = 0; z < z_size - 1; z += 2) {
...
}

changing only to_z_size = max(z_size >> 0, 1); and z+=1 in the for loop right?

Probably better to reuse filter_2d_mipmap_pages(), e.g. the same way a cube map uses it. For this purpose a texture array is more similar to a cube map (an array of six textures) than it is to a 3-d array.

David

Ah ok, I see now. I didn’t notice the for(z=0…) loop in filter_2d_mipmap_pages(…) before.

Thanks