Fixes program validation regression.
TRAC #11654
The sampler validation at render time was occurring before uniforms
were applied and samplers were bound to their texture units. Sampler
validation now occurs after shaders and textures have been applied.
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch

Author:    Shannon Woods

git-svn-id: https://angleproject.googlecode.com/svn/trunk@207 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 9903870..cdfa7c0 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -1862,11 +1862,6 @@
         return;
     }
 
-    if (!getCurrentProgram()->validateSamplers())
-    {
-        return error(GL_INVALID_OPERATION);
-    }
-
     if (!applyRenderTarget(false))
     {
         return error(GL_INVALID_FRAMEBUFFER_OPERATION);
@@ -1877,6 +1872,11 @@
     applyShaders();
     applyTextures();
 
+    if (!getCurrentProgram()->validateSamplers())
+    {
+        return error(GL_INVALID_OPERATION);
+    }
+
     if (!cullSkipsDraw(mode))
     {
         device->BeginScene();
@@ -1909,11 +1909,6 @@
         return;
     }
 
-    if (!getCurrentProgram()->validateSamplers())
-    {
-        return error(GL_INVALID_OPERATION);
-    }
-
     if (!applyRenderTarget(false))
     {
         return error(GL_INVALID_FRAMEBUFFER_OPERATION);
@@ -1925,6 +1920,11 @@
     applyShaders();
     applyTextures();
 
+    if (!getCurrentProgram()->validateSamplers())
+    {
+        return error(GL_INVALID_OPERATION);
+    }
+
     if (!cullSkipsDraw(mode))
     {
         device->BeginScene();