Commit d9b9a508 by Jamie Madill

Instead of checking if a texture is mipmap complete before we update the…

Instead of checking if a texture is mipmap complete before we update the storage, only update complete storage levels. TRAC #23996 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
parent aee7ad88
......@@ -830,11 +830,14 @@ void Texture2D::createTexture()
void Texture2D::updateTexture()
{
int levels = (isMipmapComplete() ? levelCount() : 1);
int storageLevels = levelCount();
for (int level = 0; level < levels; level++)
for (int level = 0; level < storageLevels; level++)
{
updateTextureLevel(level);
if (isLevelComplete(level))
{
updateTextureLevel(level);
}
}
}
......@@ -1296,13 +1299,16 @@ void TextureCubeMap::createTexture()
void TextureCubeMap::updateTexture()
{
int levels = (isMipmapCubeComplete() ? levelCount() : 1);
int storageLevels = levelCount();
for (int face = 0; face < 6; face++)
{
for (int level = 0; level < levels; level++)
for (int level = 0; level < storageLevels; level++)
{
updateTextureFaceLevel(face, level);
if (isFaceLevelComplete(face, level))
{
updateTextureFaceLevel(face, level);
}
}
}
}
......@@ -2047,11 +2053,14 @@ void Texture3D::createTexture()
void Texture3D::updateTexture()
{
int levels = (isMipmapComplete() ? levelCount() : 1);
int storageLevels = levelCount();
for (int level = 0; level < levels; level++)
for (int level = 0; level < storageLevels; level++)
{
updateTextureLevel(level);
if (isLevelComplete(level))
{
updateTextureLevel(level);
}
}
}
......@@ -2625,10 +2634,14 @@ void Texture2DArray::createTexture()
void Texture2DArray::updateTexture()
{
int levels = (isMipmapComplete() ? levelCount() : 1);
for (int level = 0; level < levels; level++)
int storageLevels = levelCount();
for (int level = 0; level < storageLevels; level++)
{
updateTextureLevel(level);
if (isLevelComplete(level))
{
updateTextureLevel(level);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment