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,12 +830,15 @@ void Texture2D::createTexture() ...@@ -830,12 +830,15 @@ void Texture2D::createTexture()
void Texture2D::updateTexture() 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++)
{
if (isLevelComplete(level))
{ {
updateTextureLevel(level); updateTextureLevel(level);
} }
}
} }
void Texture2D::updateTextureLevel(int level) void Texture2D::updateTextureLevel(int level)
...@@ -1296,15 +1299,18 @@ void TextureCubeMap::createTexture() ...@@ -1296,15 +1299,18 @@ void TextureCubeMap::createTexture()
void TextureCubeMap::updateTexture() void TextureCubeMap::updateTexture()
{ {
int levels = (isMipmapCubeComplete() ? levelCount() : 1); int storageLevels = levelCount();
for (int face = 0; face < 6; face++) for (int face = 0; face < 6; face++)
{ {
for (int level = 0; level < levels; level++) for (int level = 0; level < storageLevels; level++)
{
if (isFaceLevelComplete(face, level))
{ {
updateTextureFaceLevel(face, level); updateTextureFaceLevel(face, level);
} }
} }
}
} }
void TextureCubeMap::updateTextureFaceLevel(int face, int level) void TextureCubeMap::updateTextureFaceLevel(int face, int level)
...@@ -2047,12 +2053,15 @@ void Texture3D::createTexture() ...@@ -2047,12 +2053,15 @@ void Texture3D::createTexture()
void Texture3D::updateTexture() 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++)
{
if (isLevelComplete(level))
{ {
updateTextureLevel(level); updateTextureLevel(level);
} }
}
} }
void Texture3D::updateTextureLevel(int level) void Texture3D::updateTextureLevel(int level)
...@@ -2625,11 +2634,15 @@ void Texture2DArray::createTexture() ...@@ -2625,11 +2634,15 @@ void Texture2DArray::createTexture()
void Texture2DArray::updateTexture() void Texture2DArray::updateTexture()
{ {
int levels = (isMipmapComplete() ? levelCount() : 1); int storageLevels = levelCount();
for (int level = 0; level < levels; level++)
for (int level = 0; level < storageLevels; level++)
{
if (isLevelComplete(level))
{ {
updateTextureLevel(level); updateTextureLevel(level);
} }
}
} }
void Texture2DArray::updateTextureLevel(int level) void Texture2DArray::updateTextureLevel(int 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