Use attachment binding points for dynamic PS key.
Because our output signature is only dependent on the arrangment
of the attachments, not the attachment type, use the output
layout key for now. If we need to, we could store both, in the
future.
BUG=angle:705
Change-Id: I3b99954d30b91a4741fdd6f48f8ffcf88c0bea7a
Reviewed-on: https://chromium-review.googlesource.com/215846
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/FramebufferAttachment.cpp b/src/libGLESv2/FramebufferAttachment.cpp
index fa75087..994e1a5 100644
--- a/src/libGLESv2/FramebufferAttachment.cpp
+++ b/src/libGLESv2/FramebufferAttachment.cpp
@@ -22,7 +22,8 @@
////// FramebufferAttachment Implementation //////
-FramebufferAttachment::FramebufferAttachment()
+FramebufferAttachment::FramebufferAttachment(GLenum binding)
+ : mBinding(binding)
{
}
@@ -77,6 +78,10 @@
///// TextureAttachment Implementation ////////
+TextureAttachment::TextureAttachment(GLenum binding)
+ : FramebufferAttachment(binding)
+{}
+
rx::TextureStorage *TextureAttachment::getTextureStorage()
{
return getTexture()->getNativeTexture()->getStorageInstance();
@@ -99,7 +104,9 @@
///// Texture2DAttachment Implementation ////////
-Texture2DAttachment::Texture2DAttachment(Texture2D *texture, GLint level) : mLevel(level)
+Texture2DAttachment::Texture2DAttachment(GLenum binding, Texture2D *texture, GLint level)
+ : TextureAttachment(binding),
+ mLevel(level)
{
mTexture2D.set(texture);
}
@@ -161,8 +168,9 @@
///// TextureCubeMapAttachment Implementation ////////
-TextureCubeMapAttachment::TextureCubeMapAttachment(TextureCubeMap *texture, GLenum faceTarget, GLint level)
- : mFaceTarget(faceTarget), mLevel(level)
+TextureCubeMapAttachment::TextureCubeMapAttachment(GLenum binding, TextureCubeMap *texture, GLenum faceTarget, GLint level)
+ : TextureAttachment(binding),
+ mFaceTarget(faceTarget), mLevel(level)
{
mTextureCubeMap.set(texture);
}
@@ -224,8 +232,10 @@
///// Texture3DAttachment Implementation ////////
-Texture3DAttachment::Texture3DAttachment(Texture3D *texture, GLint level, GLint layer)
- : mLevel(level), mLayer(layer)
+Texture3DAttachment::Texture3DAttachment(GLenum binding, Texture3D *texture, GLint level, GLint layer)
+ : TextureAttachment(binding),
+ mLevel(level),
+ mLayer(layer)
{
mTexture3D.set(texture);
}
@@ -287,8 +297,10 @@
////// Texture2DArrayAttachment Implementation //////
-Texture2DArrayAttachment::Texture2DArrayAttachment(Texture2DArray *texture, GLint level, GLint layer)
- : mLevel(level), mLayer(layer)
+Texture2DArrayAttachment::Texture2DArrayAttachment(GLenum binding, Texture2DArray *texture, GLint level, GLint layer)
+ : TextureAttachment(binding),
+ mLevel(level),
+ mLayer(layer)
{
mTexture2DArray.set(texture);
}
@@ -350,7 +362,8 @@
////// RenderbufferAttachment Implementation //////
-RenderbufferAttachment::RenderbufferAttachment(Renderbuffer *renderbuffer)
+RenderbufferAttachment::RenderbufferAttachment(GLenum binding, Renderbuffer *renderbuffer)
+ : FramebufferAttachment(binding)
{
ASSERT(renderbuffer);
mRenderbuffer.set(renderbuffer);