Fix NPOT completeness rule.

TRAC #12561

Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch

Author:    Andrew Lewycky

git-svn-id: https://angleproject.googlecode.com/svn/trunk@340 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index cbebcbf..4079d43 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -427,8 +427,8 @@
     }
     else
     {
-        // One of the restrictions of NONPOW2CONDITIONAL is that NPOTs may only have a single level.
-        return (getContext()->getDeviceCaps().TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) ? 1 : maxlevel;
+        // OpenGL ES 2.0 without GL_OES_texture_npot does not permit NPOT mipmaps.
+        return 1;
     }
 }
 
@@ -635,7 +635,7 @@
         return false;
     }
 
-    bool mipmapping;
+    bool mipmapping = false;
 
     switch (mMinFilter)
     {
@@ -652,10 +652,15 @@
      default: UNREACHABLE();
     }
 
+    if ((getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(width))
+        || (getWrapT() != GL_CLAMP_TO_EDGE && !isPow2(height)))
+    {
+        return false;
+    }
+
     if (mipmapping)
     {
-        if ((getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(width))
-            || (getWrapT() != GL_CLAMP_TO_EDGE && !isPow2(height)))
+        if (!isPow2(width) || !isPow2(height))
         {
             return false;
         }