Commits

Anonymous committed 0e5366f

GL: Fix for incorrect mipmap calculation with texture arrays.

Comments (0)

Files changed (1)

RenderSystems/GL/src/OgreGLTexture.cpp

 						}
 						break;
 				};
-				if(width>1)		width = width/2;
-				if(height>1)	height = height/2;
-				if(depth>1)		depth = depth/2;
+				if(width>1)
+                    width = width/2;
+				if(height>1)
+                    height = height/2;
+				if(depth>1 && mTextureType != TEX_TYPE_2D_ARRAY)
+                    depth = depth/2;
 			}
 			delete [] tmpdata;
 		}
 						}
 						break;
 				};
-				if(width>1)		width = width/2;
-				if(height>1)	height = height/2;
-				if(depth>1)		depth = depth/2;
+				if(width>1)
+                    width = width/2;
+				if(height>1)
+                    height = height/2;
+				if(depth>1 && mTextureType != TEX_TYPE_2D_ARRAY)
+                    depth = depth/2;
 			}
 		}
 		_createSurfaceList();