From 007297f1a679bd5c8113df6a9c81df3d7ba3d9c2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 28 Mar 2019 15:06:19 -0400 Subject: [PATCH] cogl: COGL_FEATURE_TEXTURE_NPOT_MIPMAP is always available https://gitlab.gnome.org/GNOME/mutter/merge_requests/546 --- cogl/cogl/cogl-atlas.c | 3 +-- cogl/cogl/cogl-context.h | 3 --- cogl/cogl/cogl-types.h | 3 --- cogl/cogl/deprecated/cogl-auto-texture.c | 6 ++---- cogl/cogl/driver/gl/gl/cogl-driver-gl.c | 4 +--- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 5 +---- cogl/cogl/winsys/cogl-texture-pixmap-x11.c | 3 +-- cogl/test-fixtures/test-utils.c | 6 ++---- 8 files changed, 8 insertions(+), 25 deletions(-) diff --git a/cogl/cogl/cogl-atlas.c b/cogl/cogl/cogl-atlas.c index c7ad711e7..ba6086df1 100644 --- a/cogl/cogl/cogl-atlas.c +++ b/cogl/cogl/cogl-atlas.c @@ -563,8 +563,7 @@ create_migration_texture (CoglContext *ctx, CoglError *skip_error = NULL; if ((_cogl_util_is_pot (width) && _cogl_util_is_pot (height)) || - (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { /* First try creating a fast-path non-sliced texture */ tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, diff --git a/cogl/cogl/cogl-context.h b/cogl/cogl/cogl-context.h index 2f969c954..ddbe1f357 100644 --- a/cogl/cogl/cogl-context.h +++ b/cogl/cogl/cogl-context.h @@ -180,8 +180,6 @@ cogl_is_context (void *object); * features to know if the hardware supports npot texture mipmaps * or repeat modes other than * %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE respectively. - * @COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP: Mipmapping is supported in - * conjuntion with non power of two textures. * @COGL_FEATURE_ID_TEXTURE_NPOT: Non power of two textures are supported * by the hardware. This is a equivalent to the * %COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, %COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP @@ -232,7 +230,6 @@ cogl_is_context (void *object); typedef enum _CoglFeatureID { COGL_FEATURE_ID_TEXTURE_NPOT_BASIC = 1, - COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, COGL_FEATURE_ID_TEXTURE_NPOT, COGL_FEATURE_ID_TEXTURE_RECTANGLE, COGL_FEATURE_ID_OFFSCREEN, diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h index 82f7a24c8..86793bd81 100644 --- a/cogl/cogl/cogl-types.h +++ b/cogl/cogl/cogl-types.h @@ -339,8 +339,6 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/ * features to know if the hardware supports npot texture mipmaps * or repeat modes other than * %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE respectively. - * @COGL_FEATURE_TEXTURE_NPOT_MIPMAP: Mipmapping is supported in - * conjuntion with non power of two textures. * @COGL_FEATURE_POINT_SPRITE: Whether * cogl_material_set_layer_point_sprite_coords_enabled() is supported. * @COGL_FEATURE_MAP_BUFFER_FOR_READ: Whether cogl_buffer_map() is @@ -370,7 +368,6 @@ typedef enum COGL_FEATURE_UNSIGNED_INT_INDICES = (1 << 13), COGL_FEATURE_DEPTH_RANGE = (1 << 14), COGL_FEATURE_TEXTURE_NPOT_BASIC = (1 << 15), - COGL_FEATURE_TEXTURE_NPOT_MIPMAP = (1 << 16), COGL_FEATURE_POINT_SPRITE = (1 << 18), COGL_FEATURE_MAP_BUFFER_FOR_READ = (1 << 21), COGL_FEATURE_MAP_BUFFER_FOR_WRITE = (1 << 22), diff --git a/cogl/cogl/deprecated/cogl-auto-texture.c b/cogl/cogl/deprecated/cogl-auto-texture.c index c36c5b7a2..3ab155588 100644 --- a/cogl/cogl/deprecated/cogl-auto-texture.c +++ b/cogl/cogl/deprecated/cogl-auto-texture.c @@ -83,8 +83,7 @@ cogl_texture_new_with_size (unsigned int width, _COGL_GET_CONTEXT (ctx, NULL); if ((_cogl_util_is_pot (width) && _cogl_util_is_pot (height)) || - (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { /* First try creating a fast-path non-sliced texture */ tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height)); @@ -236,8 +235,7 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap, /* If that doesn't work try a fast path 2D texture */ if ((_cogl_util_is_pot (bitmap->width) && _cogl_util_is_pot (bitmap->height)) || - (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { tex = COGL_TEXTURE (_cogl_texture_2d_new_from_bitmap (bitmap, can_convert_in_place)); diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 5e0084974..96b12e56a 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -408,11 +408,9 @@ _cogl_driver_update_features (CoglContext *ctx, gl_extensions); flags |= COGL_FEATURE_TEXTURE_NPOT - | COGL_FEATURE_TEXTURE_NPOT_BASIC - | COGL_FEATURE_TEXTURE_NPOT_MIPMAP; + | COGL_FEATURE_TEXTURE_NPOT_BASIC; COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT, TRUE); COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE); - COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE); if (_cogl_check_extension ("GL_MESA_pack_invert", gl_extensions)) COGL_FLAGS_SET (private_features, diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 5d7edb1b2..5095f4888 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -350,13 +350,10 @@ _cogl_driver_update_features (CoglContext *context, } flags |= (COGL_FEATURE_TEXTURE_NPOT | - COGL_FEATURE_TEXTURE_NPOT_BASIC | - COGL_FEATURE_TEXTURE_NPOT_MIPMAP); + COGL_FEATURE_TEXTURE_NPOT_BASIC); COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_TEXTURE_NPOT, TRUE); COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE); - COGL_FLAGS_SET (context->features, - COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE); if (context->glMapBuffer) { diff --git a/cogl/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/cogl/winsys/cogl-texture-pixmap-x11.c index 45a323561..d0acbc709 100644 --- a/cogl/cogl/winsys/cogl-texture-pixmap-x11.c +++ b/cogl/cogl/winsys/cogl-texture-pixmap-x11.c @@ -583,8 +583,7 @@ create_fallback_texture (CoglContext *ctx, CoglError *skip_error = NULL; if ((_cogl_util_is_pot (width) && _cogl_util_is_pot (height)) || - (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { /* First try creating a fast-path non-sliced texture */ tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, diff --git a/cogl/test-fixtures/test-utils.c b/cogl/test-fixtures/test-utils.c index 183c6a3e9..7e3e233b8 100644 --- a/cogl/test-fixtures/test-utils.c +++ b/cogl/test-fixtures/test-utils.c @@ -362,8 +362,7 @@ test_utils_texture_new_with_size (CoglContext *ctx, CoglError *skip_error = NULL; if ((test_utils_is_pot (width) && test_utils_is_pot (height)) || - (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { /* First try creating a fast-path non-sliced texture */ tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, @@ -442,8 +441,7 @@ test_utils_texture_new_from_bitmap (CoglBitmap *bitmap, /* If that doesn't work try a fast path 2D texture */ if ((test_utils_is_pot (cogl_bitmap_get_width (bitmap)) && test_utils_is_pot (cogl_bitmap_get_height (bitmap))) || - (cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) && - cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP))) + (cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))) { tex = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmap));