Error out if depth textures have more than one level.

Trac #20959
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1135 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 1e5d760..5970f33 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -5373,8 +5373,9 @@
                 {
                     return error(GL_INVALID_OPERATION);
                 }
-                // OES_depth_texture supports loading depth data, but ANGLE_depth_texture does not
-                if (pixels != NULL)
+                // OES_depth_texture supports loading depth data and multiple levels,
+                // but ANGLE_depth_texture does not
+                if (pixels != NULL || level != 0)
                 {
                     return error(GL_INVALID_OPERATION);
                 }
@@ -5660,6 +5661,11 @@
                 {
                     return error(GL_INVALID_OPERATION);
                 }
+                // ANGLE_depth_texture only supports 1-level textures
+                if (levels != 1)
+                {
+                    return error(GL_INVALID_OPERATION);
+                }
                 break;
               default:
                 break;