WebGL, D3D: Forbid multiple TF outputs in one buffer

Implementing a WebGL spec change:
https://github.com/KhronosGroup/WebGL/pull/2658
Fixes WebGL 2 conformance test:
conformance2/transform_feedback/same-buffer-two-binding-points.html

Also applying the change to D3D backends because they can't support
multiple transform feedback outputs in one buffer.

Bug: chromium:866089
Change-Id: I8d7eda14225c13efb7ca1ed974239332be4e79a6
Reviewed-on: https://chromium-review.googlesource.com/c/1347749
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
index cbaa515..a038c99 100644
--- a/src/libANGLE/validationES3.cpp
+++ b/src/libANGLE/validationES3.cpp
@@ -2472,11 +2472,22 @@
     for (size_t i = 0; i < transformFeedback->getIndexedBufferCount(); i++)
     {
         const auto &buffer = transformFeedback->getIndexedBuffer(i);
-        if (buffer.get() && buffer->isMapped())
+        if (buffer.get())
         {
-            context->validationError(GL_INVALID_OPERATION,
-                                     "Transform feedback has a mapped buffer.");
-            return false;
+            if (buffer->isMapped())
+            {
+                context->validationError(GL_INVALID_OPERATION,
+                                         "Transform feedback has a mapped buffer.");
+                return false;
+            }
+            if ((context->getLimitations().noDoubleBoundTransformFeedbackBuffers ||
+                 context->getExtensions().webglCompatibility) &&
+                buffer->isDoubleBoundForTransformFeedback())
+            {
+                context->validationError(GL_INVALID_OPERATION,
+                                         kErrorDoubleBoundTransformFeedbackBuffer);
+                return false;
+            }
         }
     }