From 302a171c088f5a351d97acab36fce9f40ab99d80 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 28 Mar 2019 15:03:44 -0400 Subject: [PATCH] cogl: COGL_FEATURE_TEXTURE_NPOT_REPEAT is always available https://gitlab.gnome.org/GNOME/mutter/merge_requests/546 --- cogl/cogl/cogl-context.h | 4 ---- cogl/cogl/cogl-texture-2d.c | 9 +-------- cogl/cogl/cogl-types.h | 4 ---- cogl/cogl/driver/gl/gl/cogl-driver-gl.c | 4 +--- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 5 +---- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/cogl/cogl/cogl-context.h b/cogl/cogl/cogl-context.h index bc5df324e..2f969c954 100644 --- a/cogl/cogl/cogl-context.h +++ b/cogl/cogl/cogl-context.h @@ -182,9 +182,6 @@ cogl_is_context (void *object); * %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_REPEAT: Repeat modes other than - * %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE are supported by the - * hardware. * @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 @@ -236,7 +233,6 @@ typedef enum _CoglFeatureID { COGL_FEATURE_ID_TEXTURE_NPOT_BASIC = 1, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, - COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, COGL_FEATURE_ID_TEXTURE_NPOT, COGL_FEATURE_ID_TEXTURE_RECTANGLE, COGL_FEATURE_ID_OFFSCREEN, diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index 76f0e3a87..a768d36fa 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -505,14 +505,7 @@ _cogl_texture_2d_is_sliced (CoglTexture *tex) static gboolean _cogl_texture_2d_can_hardware_repeat (CoglTexture *tex) { - CoglContext *ctx = tex->context; - - if (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT) || - (_cogl_util_is_pot (tex->width) && - _cogl_util_is_pot (tex->height))) - return TRUE; - else - return FALSE; + return TRUE; } static void diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h index 1b8d511e4..82f7a24c8 100644 --- a/cogl/cogl/cogl-types.h +++ b/cogl/cogl/cogl-types.h @@ -341,9 +341,6 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/ * %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_TEXTURE_NPOT_REPEAT: Repeat modes other than - * %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE are supported by the - * hardware. * @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 @@ -374,7 +371,6 @@ typedef enum COGL_FEATURE_DEPTH_RANGE = (1 << 14), COGL_FEATURE_TEXTURE_NPOT_BASIC = (1 << 15), COGL_FEATURE_TEXTURE_NPOT_MIPMAP = (1 << 16), - COGL_FEATURE_TEXTURE_NPOT_REPEAT = (1 << 17), 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/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 3e709baaa..5e0084974 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -409,12 +409,10 @@ _cogl_driver_update_features (CoglContext *ctx, flags |= COGL_FEATURE_TEXTURE_NPOT | COGL_FEATURE_TEXTURE_NPOT_BASIC - | COGL_FEATURE_TEXTURE_NPOT_MIPMAP - | COGL_FEATURE_TEXTURE_NPOT_REPEAT; + | COGL_FEATURE_TEXTURE_NPOT_MIPMAP; 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); - COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, 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 33d1ba0db..5d7edb1b2 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -351,15 +351,12 @@ _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_REPEAT); + COGL_FEATURE_TEXTURE_NPOT_MIPMAP); 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); - COGL_FLAGS_SET (context->features, - COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, TRUE); if (context->glMapBuffer) {