Implement Anisotropic Texture filtering support
Bug=297
Authored-by: Conor Dickinson, Cloud Party, Inc.
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1219 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index 6ff2453..cd4d637 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -1157,6 +1157,7 @@
mWrapT = GL_REPEAT;
mDirtyParameters = true;
mUsage = GL_NONE;
+ mMaxAnisotropy = 1.0f;
mDirtyImages = true;
@@ -1253,6 +1254,22 @@
}
}
+// Returns true on successful max anisotropy update (valid anisotropy value)
+bool Texture::setMaxAnisotropy(float textureMaxAnisotropy, float contextMaxAnisotropy)
+{
+ textureMaxAnisotropy = std::min(textureMaxAnisotropy, contextMaxAnisotropy);
+ if (textureMaxAnisotropy < 1.0f)
+ {
+ return false;
+ }
+ if (mMaxAnisotropy != textureMaxAnisotropy)
+ {
+ mMaxAnisotropy = textureMaxAnisotropy;
+ mDirtyParameters = true;
+ }
+ return true;
+}
+
// Returns true on successful usage state update (valid enum parameter)
bool Texture::setUsage(GLenum usage)
{
@@ -1287,6 +1304,11 @@
return mWrapT;
}
+float Texture::getMaxAnisotropy() const
+{
+ return mMaxAnisotropy;
+}
+
GLenum Texture::getUsage() const
{
return mUsage;