mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Fix] (MG_State/Texture): relaxing completeness check on reasonable 0x0 mipmap
This commit is contained in:
@@ -164,13 +164,24 @@ namespace MobileGL {
|
||||
|
||||
SizeT levelCount = m_textureStorage.GetLevelCount();
|
||||
if (levelCount == 0) {
|
||||
MGLOG_D("%s: not complete because levelCount == 0", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// For some reason mojang decided to have 0x0 in last level mipmap
|
||||
// Relaxing checks for that
|
||||
bool hadZero = false;
|
||||
for (SizeT i = 0; i < levelCount; ++i) {
|
||||
const auto& levelSize = m_textureStorage.GetTexelSize(0, i);
|
||||
if (levelSize.x() <= 0 || levelSize.y() <= 0 || levelSize.z() <= 0) {
|
||||
return false;
|
||||
hadZero = true;
|
||||
} else {
|
||||
if (hadZero) {
|
||||
// We're checking for "zero - not zero - zero" here
|
||||
// "not zero - zero - zero" should pass this test
|
||||
MGLOG_D("%s: not complete because 0x0 occurred, and is not last level mipmap", __func__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user