Use the currently bound sampler object combined with the internal texture state to determine the
current filtering and address modes at draw time.

TRAC #23453

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Authored-by: Jamie Madill
diff --git a/src/libGLESv2/Sampler.cpp b/src/libGLESv2/Sampler.cpp
index 65a113e..4e3f231 100644
--- a/src/libGLESv2/Sampler.cpp
+++ b/src/libGLESv2/Sampler.cpp
@@ -9,6 +9,7 @@
 // sampler object. Sampler objects store some state needed to sample textures.
 
 #include "libGLESv2/Sampler.h"
+#include "libGLESv2/angletypes.h"
 
 namespace gl
 {
@@ -27,4 +28,15 @@
 {
 }
 
+void Sampler::getState(SamplerState *samplerState) const
+{
+    samplerState->minFilter = mMinFilter;
+    samplerState->magFilter = mMagFilter;
+    samplerState->wrapS     = mWrapS;
+    samplerState->wrapT     = mWrapT;
+    samplerState->wrapR     = mWrapR;
+
+    // TODO: comparison mode/func, min/max LOD
+}
+
 }