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 <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-10-13 09:30:33 +01:00
parent d045bea70e
commit 69b44ac86d
4 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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))