Commit f5b8ba6b by Jeff Gilbert Committed by Commit Bot

Set TextureGL dirty bits when workaround usage of levels changes.

Previously, we wouldn't update the dirty bits when switching from a workarounded alpha/alpha/uint8 (r8/red/uint8) to something else. Found via TextureUploadFormatTest. BUG=angleproject:2232 Change-Id: Idba63282f8a65daec5675798d3516345ca941447 Reviewed-on: https://chromium-review.googlesource.com/756641 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 661fc487
...@@ -1344,13 +1344,7 @@ void TextureGL::setLevelInfo(GLenum target, ...@@ -1344,13 +1344,7 @@ void TextureGL::setLevelInfo(GLenum target,
{ {
ASSERT(levelCount > 0); ASSERT(levelCount > 0);
GLuint baseLevel = mState.getEffectiveBaseLevel(); bool updateWorkarounds = levelInfo.depthStencilWorkaround || levelInfo.lumaWorkaround.enabled;
bool needsResync = level <= baseLevel && level + levelCount >= baseLevel &&
(levelInfo.depthStencilWorkaround || levelInfo.lumaWorkaround.enabled);
if (needsResync)
{
mLocalDirtyBits |= GetLevelWorkaroundDirtyBits();
}
for (size_t i = level; i < level + levelCount; i++) for (size_t i = level; i < level + levelCount; i++)
{ {
...@@ -1361,16 +1355,31 @@ void TextureGL::setLevelInfo(GLenum target, ...@@ -1361,16 +1355,31 @@ void TextureGL::setLevelInfo(GLenum target,
{ {
size_t index = GetLevelInfoIndex(face, level); size_t index = GetLevelInfoIndex(face, level);
ASSERT(index < mLevelInfo.size()); ASSERT(index < mLevelInfo.size());
mLevelInfo[index] = levelInfo; auto &curLevelInfo = mLevelInfo[index];
updateWorkarounds |= curLevelInfo.depthStencilWorkaround;
updateWorkarounds |= curLevelInfo.lumaWorkaround.enabled;
curLevelInfo = levelInfo;
} }
} }
else else
{ {
size_t index = GetLevelInfoIndex(target, level); size_t index = GetLevelInfoIndex(target, level);
ASSERT(index < mLevelInfo.size()); ASSERT(index < mLevelInfo.size());
mLevelInfo[index] = levelInfo; auto &curLevelInfo = mLevelInfo[index];
updateWorkarounds |= curLevelInfo.depthStencilWorkaround;
updateWorkarounds |= curLevelInfo.lumaWorkaround.enabled;
curLevelInfo = levelInfo;
} }
} }
if (updateWorkarounds)
{
mLocalDirtyBits |= GetLevelWorkaroundDirtyBits();
}
} }
const LevelInfoGL &TextureGL::getLevelInfo(GLenum target, size_t level) const const LevelInfoGL &TextureGL::getLevelInfo(GLenum target, size_t level) const
......
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