mesa: Fix error condition for valid texture targets in glTexStorage* functions
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 30 May 2014 21:55:28 +0000 (14:55 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 5 Aug 2014 00:10:48 +0000 (17:10 -0700)
Fixes gles3 Khronos CTS test: texture_storage_texture_targets

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/main/texstorage.c

index 86c8f3c922dbea4977fc7a3a242f8eebca499c6e..44b5374fdbd76bb30bb2a0df9c39891ab57dd55e 100644 (file)
 static GLboolean
 legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target)
 {
+   if (_mesa_is_gles3(ctx)
+       && target != GL_TEXTURE_2D
+       && target != GL_TEXTURE_CUBE_MAP
+       && target != GL_TEXTURE_3D
+       && target != GL_TEXTURE_2D_ARRAY)
+      return GL_FALSE;
+
    switch (dims) {
    case 1:
       switch (target) {