[Mesa-dev] [PATCH 12/17] mesa: Use _mesa_has_ARB_texture_cube_map_array instead of open-coding it
Ian Romanick
idr at freedesktop.org
Wed Aug 24 22:12:38 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/main/genmipmap.c | 3 +--
src/mesa/main/get.c | 2 +-
src/mesa/main/texobj.c | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c
index 97d3c62..5038d5c 100644
--- a/src/mesa/main/genmipmap.c
+++ b/src/mesa/main/genmipmap.c
@@ -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;
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index c21c42a..9f32acf 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1856,7 +1856,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
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 722549d..b48a980 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -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) ||
--
2.5.5
More information about the mesa-dev
mailing list