Commit 8a64926e by James Darpinian Committed by Commit Bot

Restore the active program after transform feedback

When calling EndTransformFeedback, we might change the current program. This sets a dirty bit, but it might not get cleared before the next draw call, so this change makes us manually restore the program state after calling EndTransformFeedback. This is a follow-up to: https://chromium-review.googlesource.com/c/angle/angle/+/1448661 Bug: 832238 Change-Id: I1bea1b9685f55d68b04439a9b0a305deb48708c0 Reviewed-on: https://chromium-review.googlesource.com/c/1475061 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 23ed69cb
...@@ -173,6 +173,7 @@ class StateManagerGL final : angle::NonCopyable ...@@ -173,6 +173,7 @@ class StateManagerGL final : angle::NonCopyable
} }
} }
GLuint getProgramID() const { return mProgram; }
GLuint getVertexArrayID() const { return mVAO; } GLuint getVertexArrayID() const { return mVAO; }
GLuint getFramebufferID(angle::FramebufferBinding binding) const GLuint getFramebufferID(angle::FramebufferBinding binding) const
{ {
......
...@@ -131,8 +131,14 @@ void TransformFeedbackGL::syncActiveState(const gl::Context *context, ...@@ -131,8 +131,14 @@ void TransformFeedbackGL::syncActiveState(const gl::Context *context,
} }
else else
{ {
// Implementations disagree about what should happen if a different program is bound
// when calling EndTransformFeedback. We avoid the ambiguity by always re-binding the
// program associated with this transform feedback.
GLuint previousProgram = mStateManager->getProgramID();
mStateManager->useProgram(mActiveProgram); mStateManager->useProgram(mActiveProgram);
mFunctions->endTransformFeedback(); mFunctions->endTransformFeedback();
// Restore the current program if we changed it.
mStateManager->useProgram(previousProgram);
} }
} }
} }
......
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