Commit 218b6ede by Jamie Madill

Add queries for object id and type to FBO attachments.

BUG=angle:660 Change-Id: Id91f6f2ae84eaefd59f9d568736bd99e3a27ef5d Reviewed-on: https://chromium-review.googlesource.com/201836Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 2bf8b372
......@@ -105,9 +105,14 @@ unsigned int Texture2DAttachment::getSerial() const
return mTexture2D->getRenderTargetSerial(mLevel);
}
bool Texture2DAttachment::isTexture() const
GLuint Texture2DAttachment::id() const
{
return true;
return mTexture2D->id();
}
GLenum Texture2DAttachment::type() const
{
return GL_TEXTURE_2D;
}
unsigned int Texture2DAttachment::getTextureSerial() const
......@@ -185,9 +190,14 @@ unsigned int TextureCubeMapAttachment::getSerial() const
return mTextureCubeMap->getRenderTargetSerial(mFaceTarget, mLevel);
}
bool TextureCubeMapAttachment::isTexture() const
GLuint TextureCubeMapAttachment::id() const
{
return mTextureCubeMap->id();
}
GLenum TextureCubeMapAttachment::type() const
{
return true;
return mFaceTarget;
}
unsigned int TextureCubeMapAttachment::getTextureSerial() const
......@@ -265,9 +275,14 @@ unsigned int Texture3DAttachment::getSerial() const
return mTexture3D->getRenderTargetSerial(mLevel, mLayer);
}
bool Texture3DAttachment::isTexture() const
GLuint Texture3DAttachment::id() const
{
return true;
return mTexture3D->id();
}
GLenum Texture3DAttachment::type() const
{
return GL_TEXTURE_3D;
}
unsigned int Texture3DAttachment::getTextureSerial() const
......@@ -343,9 +358,14 @@ unsigned int Texture2DArrayAttachment::getSerial() const
return mTexture2DArray->getRenderTargetSerial(mLevel, mLayer);
}
bool Texture2DArrayAttachment::isTexture() const
GLuint Texture2DArrayAttachment::id() const
{
return mTexture2DArray->id();
}
GLenum Texture2DArrayAttachment::type() const
{
return true;
return GL_TEXTURE_2D_ARRAY;
}
unsigned int Texture2DArrayAttachment::getTextureSerial() const
......@@ -500,6 +520,11 @@ GLenum FramebufferAttachment::getColorEncoding(int clientVersion) const
return gl::GetColorEncoding(getActualFormat(), clientVersion);
}
bool FramebufferAttachment::isTexture() const
{
return (type() != GL_RENDERBUFFER);
}
GLsizei FramebufferAttachment::getSamples() const
{
return mImpl->getSamples();
......@@ -510,9 +535,14 @@ unsigned int FramebufferAttachment::getSerial() const
return mImpl->getSerial();
}
bool FramebufferAttachment::isTexture() const
GLuint FramebufferAttachment::id() const
{
return mImpl->isTexture();
return mImpl->id();
}
GLuint FramebufferAttachment::type() const
{
return mImpl->type();
}
unsigned int FramebufferAttachment::getTextureSerial() const
......@@ -585,9 +615,14 @@ unsigned int RenderbufferAttachment::getSerial() const
return mRenderbuffer->getStorage()->getSerial();
}
bool RenderbufferAttachment::isTexture() const
GLuint RenderbufferAttachment::id() const
{
return mRenderbuffer->id();
}
GLenum RenderbufferAttachment::type() const
{
return false;
return GL_RENDERBUFFER;
}
unsigned int RenderbufferAttachment::getTextureSerial() const
......
......@@ -70,10 +70,12 @@ class FramebufferAttachment : public RefCountObject
GLenum getComponentType(int clientVersion) const;
GLenum getColorEncoding(int clientVersion) const;
GLsizei getSamples() const;
bool isTexture() const;
unsigned int getSerial() const;
bool isTexture() const;
GLuint id() const;
GLenum type() const;
unsigned int getTextureSerial() const;
void setImplementation(FramebufferAttachmentImpl *newImpl);
......@@ -106,7 +108,8 @@ class FramebufferAttachmentImpl
virtual unsigned int getSerial() const = 0;
virtual bool isTexture() const = 0;
virtual GLuint id() const = 0;
virtual GLenum type() const = 0;
virtual unsigned int getTextureSerial() const = 0;
private:
......@@ -135,7 +138,8 @@ class Texture2DAttachment : public FramebufferAttachmentImpl
virtual unsigned int getSerial() const;
virtual bool isTexture() const;
virtual GLuint id() const;
virtual GLenum type() const;
virtual unsigned int getTextureSerial() const;
private:
......@@ -167,7 +171,8 @@ class TextureCubeMapAttachment : public FramebufferAttachmentImpl
virtual unsigned int getSerial() const;
virtual bool isTexture() const;
virtual GLuint id() const;
virtual GLenum type() const;
virtual unsigned int getTextureSerial() const;
private:
......@@ -200,7 +205,8 @@ class Texture3DAttachment : public FramebufferAttachmentImpl
virtual unsigned int getSerial() const;
virtual bool isTexture() const;
virtual GLuint id() const;
virtual GLenum type() const;
virtual unsigned int getTextureSerial() const;
private:
......@@ -233,7 +239,8 @@ class Texture2DArrayAttachment : public FramebufferAttachmentImpl
virtual unsigned int getSerial() const;
virtual bool isTexture() const;
virtual GLuint id() const;
virtual GLenum type() const;
virtual unsigned int getTextureSerial() const;
private:
......@@ -263,7 +270,8 @@ class RenderbufferAttachment : public FramebufferAttachmentImpl
virtual unsigned int getSerial() const;
virtual bool isTexture() const;
virtual GLuint id() const;
virtual GLenum type() const;
virtual unsigned int getTextureSerial() const;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment