Commit cc4ce4a2 by Geoff Lang Committed by Commit Bot

Don't initialize textures on SubImage calls if the whole image will be filled.

BUG=angleproject:2107 BUG=angleproject:2196 Change-Id: I3e7e78bfc64f1683921af2e48fe20c7be0b85af3 Reviewed-on: https://chromium-review.googlesource.com/734228 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 815a6c9a
...@@ -1446,9 +1446,16 @@ Error Texture::ensureSubImageInitialized(const Context *context, ...@@ -1446,9 +1446,16 @@ Error Texture::ensureSubImageInitialized(const Context *context,
// Pre-initialize the texture contents if necessary. // Pre-initialize the texture contents if necessary.
// TODO(jmadill): Check if area overlaps the entire texture. // TODO(jmadill): Check if area overlaps the entire texture.
const auto &imageIndex = GetImageIndexFromDescIndex(target, level); const auto &imageIndex = GetImageIndexFromDescIndex(target, level);
if (initState(imageIndex) == InitState::MayNeedInit) const auto &desc = mState.getImageDesc(imageIndex);
if (desc.initState == InitState::MayNeedInit)
{
bool coversWholeImage = area.x == 0 && area.y == 0 && area.z == 0 &&
area.width == desc.size.width && area.height == desc.size.height &&
area.depth == desc.size.depth;
if (!coversWholeImage)
{ {
ANGLE_TRY(initializeContents(context, imageIndex)); ANGLE_TRY(initializeContents(context, imageIndex));
}
setInitState(imageIndex, InitState::Initialized); setInitState(imageIndex, InitState::Initialized);
} }
......
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