diff --git a/cogl/cogl/cogl-private.h b/cogl/cogl/cogl-private.h index 91569b4ec..769510289 100644 --- a/cogl/cogl/cogl-private.h +++ b/cogl/cogl/cogl-private.h @@ -46,6 +46,8 @@ typedef enum COGL_PRIVATE_FEATURE_EXT_PACKED_DEPTH_STENCIL, COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT, COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE, COGL_PRIVATE_FEATURE_SAMPLER_OBJECTS, COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_FORMAT, diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 3c2231ebc..320005355 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -506,6 +506,14 @@ _cogl_driver_update_features (CoglContext *ctx, COGL_FEATURE_ID_TEXTURE_RG, TRUE); + COGL_FLAGS_SET (private_features, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102, TRUE); + + if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 3, 0)) + COGL_FLAGS_SET (private_features, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT, + TRUE); + /* Cache features */ for (i = 0; i < G_N_ELEMENTS (private_features); i++) ctx->private_features[i] |= private_features[i]; diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 3cb11af69..4c69bf56e 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -355,6 +355,14 @@ _cogl_driver_update_features (CoglContext *context, COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888, TRUE); + if (_cogl_check_extension ("GL_EXT_texture_type_2_10_10_10_REV", gl_extensions)) + COGL_FLAGS_SET (private_features, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102, TRUE); + + if (_cogl_check_extension ("GL_OES_texture_half_float", gl_extensions)) + COGL_FLAGS_SET (private_features, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT, TRUE); + if (_cogl_check_extension ("GL_EXT_unpack_subimage", gl_extensions)) COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE, TRUE);