mesa: Add missing checks for GL_TEXTURE_CUBE_MAP_ARRAY
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 20 Nov 2013 21:22:05 +0000 (13:22 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 5 Dec 2013 01:22:42 +0000 (17:22 -0800)
That enum requires GL_ARB_texture_cube_map_array, and it is only
available on desktop GL.  It looks like this has been an un-noticed
issue since GL_ARB_texture_cube_map_array support was added in commit
e0e7e295.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/texobj.c

index abd30c56320c1536150c36bd107ecd12f3459fbb..c110f5044698562c5597cfb528fbced5aeb21e20 100644 (file)
@@ -1205,7 +1205,8 @@ target_enum_to_index(struct gl_context *ctx, GLenum target)
       return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external
          ? TEXTURE_EXTERNAL_INDEX : -1;
    case GL_TEXTURE_CUBE_MAP_ARRAY:
-      return TEXTURE_CUBE_ARRAY_INDEX;
+      return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_cube_map_array
+         ? TEXTURE_CUBE_ARRAY_INDEX : -1;
    case GL_TEXTURE_2D_MULTISAMPLE:
       return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample
          ? TEXTURE_2D_MULTISAMPLE_INDEX: -1;