Commit 712fea9a by Cody Northrop Committed by Commit Bot

Sync state when calling getTexImage

ANGLE's mid-execution capture was failing after changes to defer clears. There were still textures with pending updates and dirty bits after SwapBuffers. This caused our calls to Texture::getTexImage to assert. This was due to a bug where getTexImage was not syncing state. This change makes the function non-const so that it can update state directly. TBR=cnorthrop@google.com,courtneygo@google.com,jmadill@chromium.org Test: Manhattan MEC Bug: angleproject:4517 Change-Id: I717ad44cfc60ae0d4483721f1c91e47c5dda3939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186170Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent a2ec926c
......@@ -2020,8 +2020,8 @@ void CaptureMidExecutionSetup(const gl::Context *context,
for (const auto &textureIter : textures)
{
gl::TextureID id = {textureIter.first};
const gl::Texture *texture = textureIter.second;
gl::TextureID id = {textureIter.first};
gl::Texture *texture = textureIter.second;
if (id.value == 0)
{
......
......@@ -1985,8 +1985,13 @@ angle::Result Texture::getTexImage(const Context *context,
GLint level,
GLenum format,
GLenum type,
void *pixels) const
void *pixels)
{
if (hasAnyDirtyBit())
{
ANGLE_TRY(syncState(context));
}
return mTexture->getTexImage(context, packState, packBuffer, target, level, format, type,
pixels);
}
......
......@@ -501,7 +501,7 @@ class Texture final : public RefCountObject<TextureID>,
GLint level,
GLenum format,
GLenum type,
void *pixels) const;
void *pixels);
rx::TextureImpl *getImplementation() const { return mTexture; }
......
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