Commit 5efe6118 by Alexis Hetu Committed by Alexis Hétu

Assert there are no unmatched eglBindTexImage/eglReleaseTexImage

Two consecutive eglBindTexImage calls on the same buffer (texture) would eventually result in a crash if the texture is released before the egl surfaces, so this assert is meant to perform an early detection of a harder to detect future issue. Bug chromium:932986 chromium:929088 Change-Id: I10b3892fe06d491c8a0a09dec84678b25f49c6ab Reviewed-on: https://swiftshader-review.googlesource.com/c/25128Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent e2d8b128
...@@ -450,6 +450,8 @@ void Texture2D::bindTexImage(gl::Surface *surface) ...@@ -450,6 +450,8 @@ void Texture2D::bindTexImage(gl::Surface *surface)
image[0] = surface->getRenderTarget(); image[0] = surface->getRenderTarget();
assert(!mSurface); // eglBindTexImage called before eglReleaseTexImage
mSurface = surface; mSurface = surface;
mSurface->setBoundTexture(this); mSurface->setBoundTexture(this);
} }
......
...@@ -561,6 +561,8 @@ void Texture2D::bindTexImage(gl::Surface *surface) ...@@ -561,6 +561,8 @@ void Texture2D::bindTexImage(gl::Surface *surface)
image[0] = surface->getRenderTarget(); image[0] = surface->getRenderTarget();
assert(!mSurface); // eglBindTexImage called before eglReleaseTexImage
mSurface = surface; mSurface = surface;
mSurface->setBoundTexture(this); mSurface->setBoundTexture(this);
} }
......
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