+ // Move them into an array texture, since that's how the rest of the code
+ // would like them.
+ int levels = find_num_levels(width1, height1);
+ GLuint image_tex;
+ glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, &image_tex);
+ glTextureStorage3D(image_tex, levels, GL_RGBA8, width1, height1, 2);
+ glCopyImageSubData(tex0, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, width1, height1, 1);
+ glCopyImageSubData(tex1, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 1, width1, height1, 1);
+ glDeleteTextures(1, &tex0);
+ glDeleteTextures(1, &tex1);
+ glGenerateTextureMipmap(image_tex);
+