mesa: Use _mesa_has_ARB_texture_cube_map_array instead of open-coding it
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 18 Aug 2016 09:09:41 +0000 (10:09 +0100)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Aug 2016 22:03:15 +0000 (15:03 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/genmipmap.c
src/mesa/main/get.c
src/mesa/main/texobj.c

index 97d3c62b7bbc397f257aeeeeded0279657f99236..5038d5cc053efed2a393b41185b5d107c2d432ca 100644 (file)
@@ -65,8 +65,7 @@ _mesa_is_valid_generate_texture_mipmap_target(struct gl_context *ctx,
          || !ctx->Extensions.EXT_texture_array;
       break;
    case GL_TEXTURE_CUBE_MAP_ARRAY:
-      error = _mesa_is_gles(ctx) ||
-              !ctx->Extensions.ARB_texture_cube_map_array;
+      error = !_mesa_has_ARB_texture_cube_map_array(ctx);
       break;
    default:
       error = true;
index 97dfb0c59fdd0efb0a000edf68b172b7e855c46c..e22bb5ff6a530d4ef79fdc9921b988d59b12c3e4 100644 (file)
@@ -1858,7 +1858,7 @@ tex_binding_to_index(const struct gl_context *ctx, GLenum binding)
               _mesa_has_OES_texture_buffer(ctx)) ?
              TEXTURE_BUFFER_INDEX : -1;
    case GL_TEXTURE_BINDING_CUBE_MAP_ARRAY:
-      return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_cube_map_array
+      return _mesa_has_ARB_texture_cube_map_array(ctx)
          ? TEXTURE_CUBE_ARRAY_INDEX : -1;
    case GL_TEXTURE_BINDING_2D_MULTISAMPLE:
       return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample
index 722549d5da9f3526708060564a106c6533dca9c1..b48a980dc178b7ad1a8d202cc40296b74be9a818 100644 (file)
@@ -1579,7 +1579,7 @@ _mesa_tex_target_to_index(const 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 _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_cube_map_array
+      return _mesa_has_ARB_texture_cube_map_array(ctx)
          ? TEXTURE_CUBE_ARRAY_INDEX : -1;
    case GL_TEXTURE_2D_MULTISAMPLE:
       return ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample) ||