From 69b44ac86d4ca8ce7497cafc648ec23a92ad8eac Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 13 Oct 2011 09:30:33 +0100 Subject: [PATCH] make COGL_FEATURE_PBOS a private feature Cogl provides a consistent public interface regardless of whether the underlying GL driver supports PBOs so it doesn't make much sense to have this feature as part of the public api. We can't break the api by removing the enum but at least we no longer ever set the feature flag. We now have a replacement private feature flag COGL_PRIVATE_FEATURE_PBOS which cogl now checks for internally. Reviewed-by: Neil Roberts --- cogl/cogl-context.c | 2 +- cogl/cogl-internal.h | 3 ++- cogl/cogl-pixel-buffer.c | 2 +- cogl/driver/gl/cogl-gl.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c index e16957d9d..4c75c36f1 100644 --- a/cogl/cogl-context.c +++ b/cogl/cogl-context.c @@ -77,7 +77,7 @@ _cogl_init_feature_overrides (CoglContext *ctx) ctx->feature_flags &= ~COGL_FEATURE_VBOS; if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_PBOS))) - ctx->feature_flags &= ~COGL_FEATURE_PBOS; + ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_PBOS; if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_ARBFP))) ctx->feature_flags &= ~COGL_FEATURE_SHADERS_ARBFP; diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h index 5c43093b6..b67186896 100644 --- a/cogl/cogl-internal.h +++ b/cogl/cogl-internal.h @@ -131,7 +131,8 @@ typedef enum COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1, COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT = 1L<<3, - COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4 + COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4, + COGL_PRIVATE_FEATURE_PBOS = 1L<<5 } CoglPrivateFeatureFlags; /* Sometimes when evaluating pipelines, either during comparisons or diff --git a/cogl/cogl-pixel-buffer.c b/cogl/cogl-pixel-buffer.c index e8a1b06bb..e49d4a824 100644 --- a/cogl/cogl-pixel-buffer.c +++ b/cogl/cogl-pixel-buffer.c @@ -76,7 +76,7 @@ _cogl_pixel_buffer_new (unsigned int size) _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE); - if (!cogl_features_available (COGL_FEATURE_PBOS)) + if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_PBOS)) use_malloc = TRUE; else use_malloc = FALSE; diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c index adff2811d..f0a9c4e48 100644 --- a/cogl/driver/gl/cogl-gl.c +++ b/cogl/driver/gl/cogl-gl.c @@ -200,7 +200,7 @@ _cogl_gl_update_features (CoglContext *context, if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 1) || _cogl_check_extension ("GL_EXT_pixel_buffer_object", gl_extensions)) - flags |= COGL_FEATURE_PBOS; + private_flags |= COGL_PRIVATE_FEATURE_PBOS; if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) || _cogl_check_extension ("GL_ARB_point_sprite", gl_extensions))