Bug 1427668 - Flush on mac after EndTransformFeedback. - r=daoshengmu
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 03 Jan 2018 17:07:36 -0800
changeset 449848 2ba0c8df9a6786d5a70065b03ac66ffbe05695cb
parent 449847 e8afea9b08757dc6a3415ebd38dbd572d1ec7a45
child 449849 04af74d5cdba3975a7f0b7ceaf62b1498574e45f
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu
bugs1427668
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1427668 - Flush on mac after EndTransformFeedback. - r=daoshengmu MozReview-Commit-ID: A0Tbk2pIng
dom/canvas/WebGLTransformFeedback.cpp
--- 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--;