Commit a11db2ac by Jamie Madill Committed by Commit Bot

Fix D3D9 context state sync.

Calling eglMakeCurrent between different D3D9 contexts could lead to state sync bugs. This fixes the problem by ensuring all internal state is dirtied between makeCurrent calls. This bug turned up when refactoring the tests to run multiple Contexts with the same EGLDisplay. Bug: angleproject:3261 Change-Id: Ic91e1af8b2615e7e7e0d0faabeb533d075ea2e91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531534 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent 6ce1be5a
...@@ -276,6 +276,7 @@ GLint64 Context9::getTimestamp() ...@@ -276,6 +276,7 @@ GLint64 Context9::getTimestamp()
angle::Result Context9::onMakeCurrent(const gl::Context *context) angle::Result Context9::onMakeCurrent(const gl::Context *context)
{ {
mRenderer->getStateManager()->setAllDirtyBits();
return mRenderer->ensureVertexDataManagerInitialized(context); return mRenderer->ensureVertexDataManagerInitialized(context);
} }
......
...@@ -68,6 +68,7 @@ class StateManager9 final : angle::NonCopyable ...@@ -68,6 +68,7 @@ class StateManager9 final : angle::NonCopyable
int getRenderTargetWidth() const { return mRenderTargetBounds.width; } int getRenderTargetWidth() const { return mRenderTargetBounds.width; }
int getRenderTargetHeight() const { return mRenderTargetBounds.height; } int getRenderTargetHeight() const { return mRenderTargetBounds.height; }
void setAllDirtyBits() { mDirtyBits.set(); }
void resetDirtyBits() { mDirtyBits.reset(); } void resetDirtyBits() { mDirtyBits.reset(); }
private: private:
......
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