From 7fb1315945577db4fe2f852cfb02530b51a35353 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Sun, 7 Aug 2016 11:25:40 -0700 Subject: [PATCH] Properly track the max mip --- libraries/gpu/src/gpu/Texture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/gpu/src/gpu/Texture.cpp b/libraries/gpu/src/gpu/Texture.cpp index 429cc5aeba..93f31f61df 100755 --- a/libraries/gpu/src/gpu/Texture.cpp +++ b/libraries/gpu/src/gpu/Texture.cpp @@ -363,6 +363,7 @@ bool Texture::assignStoredMip(uint16 level, const Element& format, Size size, co Size expectedSize = evalStoredMipSize(level, format); if (size == expectedSize) { _storage->assignMipData(level, format, size, bytes); + _maxMip = std::max(_maxMip, level); _stamp++; return true; } else if (size > expectedSize) { @@ -371,6 +372,7 @@ bool Texture::assignStoredMip(uint16 level, const Element& format, Size size, co // We should probably consider something a bit more smart to get the correct result but for now (UI elements) // it seems to work... _storage->assignMipData(level, format, size, bytes); + _maxMip = std::max(_maxMip, level); _stamp++; return true; }