nine: fix incorrect calculation of layer count for 3D textures