Add queries for level and layer to FBO attachments.

BUG=angle:660

Change-Id: I03e76dd7743267dc0b57cf53a4d27cd75a5d5adf
Reviewed-on: https://chromium-review.googlesource.com/201837
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/FramebufferAttachment.cpp b/src/libGLESv2/FramebufferAttachment.cpp
index 072177f..ee26f19 100644
--- a/src/libGLESv2/FramebufferAttachment.cpp
+++ b/src/libGLESv2/FramebufferAttachment.cpp
@@ -115,6 +115,16 @@
     return GL_TEXTURE_2D;
 }
 
+GLint Texture2DAttachment::mipLevel() const
+{
+    return mLevel;
+}
+
+GLint Texture2DAttachment::layer() const
+{
+    return 0;
+}
+
 unsigned int Texture2DAttachment::getTextureSerial() const
 {
     return mTexture2D->getTextureSerial();
@@ -200,6 +210,16 @@
     return mFaceTarget;
 }
 
+GLint TextureCubeMapAttachment::mipLevel() const
+{
+    return mLevel;
+}
+
+GLint TextureCubeMapAttachment::layer() const
+{
+    return 0;
+}
+
 unsigned int TextureCubeMapAttachment::getTextureSerial() const
 {
     return mTextureCubeMap->getTextureSerial();
@@ -285,6 +305,16 @@
     return GL_TEXTURE_3D;
 }
 
+GLint Texture3DAttachment::mipLevel() const
+{
+    return mLevel;
+}
+
+GLint Texture3DAttachment::layer() const
+{
+    return mLayer;
+}
+
 unsigned int Texture3DAttachment::getTextureSerial() const
 {
     return mTexture3D->getTextureSerial();
@@ -368,6 +398,16 @@
     return GL_TEXTURE_2D_ARRAY;
 }
 
+GLint Texture2DArrayAttachment::mipLevel() const
+{
+    return mLevel;
+}
+
+GLint Texture2DArrayAttachment::layer() const
+{
+    return mLayer;
+}
+
 unsigned int Texture2DArrayAttachment::getTextureSerial() const
 {
     return mTexture2DArray->getTextureSerial();
@@ -545,6 +585,16 @@
     return mImpl->type();
 }
 
+GLint FramebufferAttachment::mipLevel() const
+{
+    return mImpl->mipLevel();
+}
+
+GLint FramebufferAttachment::layer() const
+{
+    return mImpl->layer();
+}
+
 unsigned int FramebufferAttachment::getTextureSerial() const
 {
     return mImpl->getTextureSerial();
@@ -625,6 +675,16 @@
     return GL_RENDERBUFFER;
 }
 
+GLint RenderbufferAttachment::mipLevel() const
+{
+    return 0;
+}
+
+GLint RenderbufferAttachment::layer() const
+{
+    return 0;
+}
+
 unsigned int RenderbufferAttachment::getTextureSerial() const
 {
     UNREACHABLE();
diff --git a/src/libGLESv2/FramebufferAttachment.h b/src/libGLESv2/FramebufferAttachment.h
index 1f47263..62d9aad 100644
--- a/src/libGLESv2/FramebufferAttachment.h
+++ b/src/libGLESv2/FramebufferAttachment.h
@@ -76,6 +76,8 @@
 
     GLuint id() const;
     GLenum type() const;
+    GLint mipLevel() const;
+    GLint layer() const;
     unsigned int getTextureSerial() const;
 
     void setImplementation(FramebufferAttachmentImpl *newImpl);
@@ -110,6 +112,8 @@
 
     virtual GLuint id() const = 0;
     virtual GLenum type() const = 0;
+    virtual GLint mipLevel() const = 0;
+    virtual GLint layer() const = 0;
     virtual unsigned int getTextureSerial() const = 0;
 
   private:
@@ -140,6 +144,8 @@
 
     virtual GLuint id() const;
     virtual GLenum type() const;
+    virtual GLint mipLevel() const;
+    virtual GLint layer() const;
     virtual unsigned int getTextureSerial() const;
 
   private:
@@ -173,6 +179,8 @@
 
     virtual GLuint id() const;
     virtual GLenum type() const;
+    virtual GLint mipLevel() const;
+    virtual GLint layer() const;
     virtual unsigned int getTextureSerial() const;
 
   private:
@@ -207,6 +215,8 @@
 
     virtual GLuint id() const;
     virtual GLenum type() const;
+    virtual GLint mipLevel() const;
+    virtual GLint layer() const;
     virtual unsigned int getTextureSerial() const;
 
   private:
@@ -241,6 +251,8 @@
 
     virtual GLuint id() const;
     virtual GLenum type() const;
+    virtual GLint mipLevel() const;
+    virtual GLint layer() const;
     virtual unsigned int getTextureSerial() const;
 
   private:
@@ -272,6 +284,8 @@
 
     virtual GLuint id() const;
     virtual GLenum type() const;
+    virtual GLint mipLevel() const;
+    virtual GLint layer() const;
     virtual unsigned int getTextureSerial() const;
 
   private: