Bug 1427668 - Flush on mac after EndTransformFeedback. - r=daoshengmu
MozReview-Commit-ID: A0Tbk2pIng
--- a/dom/canvas/WebGLTransformFeedback.cpp
+++ b/dom/canvas/WebGLTransformFeedback.cpp
@@ -118,16 +118,28 @@ WebGLTransformFeedback::EndTransformFeed
if (!mIsActive)
return mContext->ErrorInvalidOperation("%s: Not active.", funcName);
////
const auto& gl = mContext->gl;
gl->fEndTransformFeedback();
+ if (gl->WorkAroundDriverBugs()) {
+#ifdef XP_MACOSX
+ // Multi-threaded GL on mac will generate INVALID_OP in some cases for at least
+ // BindBufferBase after an EndTransformFeedback if there is not a flush between
+ // the two.
+ // Single-threaded GL does not have this issue.
+ // This is likely due to not synchronizing client/server state, and erroring in
+ // BindBufferBase because the client thinks we're still in transform feedback.
+ gl->fFlush();
+#endif
+ }
+
////
mIsActive = false;
mIsPaused = false;
////
mActive_Program->mNumActiveTFOs--;