WebGL Compat: Add DEPTH_STENCIL attachments.

This is a special WebGL 1 binding point, that does not correspond to
any native functionality. Due to particularities in validation we
need to represent this with additional state in the Framebuffer.
WebGL 2 fixes this oddity by resolving to the GLES 3 native spec.

In order to pass the WebGL framebuffer objects test, we will also
need a chromium-side CL to work with the additional state tracking
it does in the blink layer, and an additional patch to ANGLE to
clear the depth buffer before the first use (robust resource init).

BUG=angleproject:1708

Change-Id: I111f8f5a451cce7de6cf281a6bc335b92dd2daf2
Reviewed-on: https://chromium-review.googlesource.com/444095
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 65152b9..eb33586 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -2123,7 +2123,7 @@
     // allocation map management either here or in the resource manager at detach time.
     // Zero textures are held by the Context, and we don't attempt to request them from
     // the State.
-    mGLState.detachTexture(mZeroTextures, texture);
+    mGLState.detachTexture(this, mZeroTextures, texture);
 }
 
 void Context::detachBuffer(GLuint buffer)
@@ -2162,7 +2162,7 @@
 
 void Context::detachRenderbuffer(GLuint renderbuffer)
 {
-    mGLState.detachRenderbuffer(renderbuffer);
+    mGLState.detachRenderbuffer(this, renderbuffer);
 }
 
 void Context::detachVertexArray(GLuint vertexArray)
@@ -2738,11 +2738,11 @@
             index = ImageIndex::MakeCube(textarget, level);
         }
 
-        framebuffer->setAttachment(GL_TEXTURE, attachment, index, textureObj);
+        framebuffer->setAttachment(this, GL_TEXTURE, attachment, index, textureObj);
     }
     else
     {
-        framebuffer->resetAttachment(attachment);
+        framebuffer->resetAttachment(this, attachment);
     }
 
     mGLState.setObjectDirty(target);
@@ -2759,12 +2759,13 @@
     if (renderbuffer != 0)
     {
         Renderbuffer *renderbufferObject = getRenderbuffer(renderbuffer);
-        framebuffer->setAttachment(GL_RENDERBUFFER, attachment, gl::ImageIndex::MakeInvalid(),
+
+        framebuffer->setAttachment(this, GL_RENDERBUFFER, attachment, gl::ImageIndex::MakeInvalid(),
                                    renderbufferObject);
     }
     else
     {
-        framebuffer->resetAttachment(attachment);
+        framebuffer->resetAttachment(this, attachment);
     }
 
     mGLState.setObjectDirty(target);
@@ -2795,11 +2796,11 @@
             index = ImageIndex::Make2DArray(level, layer);
         }
 
-        framebuffer->setAttachment(GL_TEXTURE, attachment, index, textureObject);
+        framebuffer->setAttachment(this, GL_TEXTURE, attachment, index, textureObject);
     }
     else
     {
-        framebuffer->resetAttachment(attachment);
+        framebuffer->resetAttachment(this, attachment);
     }
 
     mGLState.setObjectDirty(target);