2
0
Эх сурвалжийг харах

Fix OpenGL texture partial update.

Lasse Öörni 12 жил өмнө
parent
commit
c097d8f122

+ 1 - 4
Source/Engine/Graphics/OpenGL/OGLTexture2D.cpp

@@ -210,12 +210,9 @@ bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, con
         return false;
     }
     
-    bool wholeLevel = x == 0 && y == 0 && width == levelWidth && height == levelHeight;
-    // Use Direct3D convention with the vertical coordinates ie. 0 is top
-    y = levelHeight - (y + height);
-    
     graphics_->SetTextureForUpdate(this);
     
+    bool wholeLevel = x == 0 && y == 0 && width == levelWidth && height == levelHeight;
     unsigned format = GetSRGB() ? GetSRGBFormat(format_) : format_;
     
     if (!IsCompressed())

+ 1 - 4
Source/Engine/Graphics/OpenGL/OGLTextureCube.cpp

@@ -213,12 +213,9 @@ bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int wi
         return false;
     }
     
-    bool wholeLevel = x == 0 && y == 0 && width == levelWidth && height == levelHeight;
-    // Use Direct3D convention with the vertical coordinates ie. 0 is top
-    y = levelHeight - (y + height);
-    
     graphics_->SetTextureForUpdate(this);
     
+    bool wholeLevel = x == 0 && y == 0 && width == levelWidth && height == levelHeight;
     unsigned format = GetSRGB() ? GetSRGBFormat(format_) : format_;
     
     if (!IsCompressed())