mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
make COGL_FEATURE_VBOS a private feature
Cogl provides a consistent public interface regardless of whether the underlying GL driver supports VBOs 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_VBOS which cogl now checks for internally. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
69b44ac86d
commit
c86f698eb9
@ -32,6 +32,7 @@
|
||||
#include "cogl-object-private.h"
|
||||
#include "cogl-attribute-buffer.h"
|
||||
#include "cogl-attribute-buffer-private.h"
|
||||
#include "cogl-context-private.h"
|
||||
|
||||
static void _cogl_attribute_buffer_free (CoglAttributeBuffer *array);
|
||||
|
||||
@ -43,7 +44,9 @@ cogl_attribute_buffer_new (gsize bytes, const void *data)
|
||||
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
|
||||
gboolean use_malloc;
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_VBOS))
|
||||
_COGL_GET_CONTEXT (ctx, NULL);
|
||||
|
||||
if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
use_malloc = TRUE;
|
||||
else
|
||||
use_malloc = FALSE;
|
||||
|
@ -74,7 +74,7 @@ static void
|
||||
_cogl_init_feature_overrides (CoglContext *ctx)
|
||||
{
|
||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_VBOS)))
|
||||
ctx->feature_flags &= ~COGL_FEATURE_VBOS;
|
||||
ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_VBOS;
|
||||
|
||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_PBOS)))
|
||||
ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_PBOS;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "cogl-object-private.h"
|
||||
#include "cogl-indices.h"
|
||||
#include "cogl-indices-private.h"
|
||||
#include "cogl-context-private.h"
|
||||
|
||||
static void _cogl_index_buffer_free (CoglIndexBuffer *indices);
|
||||
|
||||
@ -46,7 +47,9 @@ cogl_index_buffer_new (gsize bytes)
|
||||
CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
|
||||
gboolean use_malloc;
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_VBOS))
|
||||
_COGL_GET_CONTEXT (ctx, NULL);
|
||||
|
||||
if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
use_malloc = TRUE;
|
||||
else
|
||||
use_malloc = FALSE;
|
||||
|
@ -132,7 +132,8 @@ typedef enum
|
||||
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_PBOS = 1L<<5
|
||||
COGL_PRIVATE_FEATURE_PBOS = 1L<<5,
|
||||
COGL_PRIVATE_FEATURE_VBOS = 1L<<6
|
||||
} CoglPrivateFeatureFlags;
|
||||
|
||||
/* Sometimes when evaluating pipelines, either during comparisons or
|
||||
|
@ -1118,10 +1118,12 @@ create_attribute_buffer (CoglJournal *journal,
|
||||
{
|
||||
CoglAttributeBuffer *vbo;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NULL);
|
||||
|
||||
/* If CoglBuffers are being emulated with malloc then there's not
|
||||
really any point in using the pool so we'll just allocate the
|
||||
buffer directly */
|
||||
if (!cogl_features_available (COGL_FEATURE_VBOS))
|
||||
if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
return cogl_attribute_buffer_new (n_bytes, NULL);
|
||||
|
||||
vbo = journal->vbo_pool[journal->next_vbo_in_pool];
|
||||
|
@ -213,9 +213,11 @@ _cogl_gl_update_features (CoglContext *context,
|
||||
flags |= COGL_FEATURE_SHADERS_GLSL;
|
||||
|
||||
if (context->glGenBuffers)
|
||||
flags |= (COGL_FEATURE_VBOS |
|
||||
COGL_FEATURE_MAP_BUFFER_FOR_READ |
|
||||
COGL_FEATURE_MAP_BUFFER_FOR_WRITE);
|
||||
{
|
||||
private_flags |= COGL_PRIVATE_FEATURE_VBOS;
|
||||
flags |= (COGL_FEATURE_MAP_BUFFER_FOR_READ |
|
||||
COGL_FEATURE_MAP_BUFFER_FOR_WRITE);
|
||||
}
|
||||
|
||||
if (_cogl_check_extension ("GL_ARB_texture_rectangle", gl_extensions))
|
||||
flags |= COGL_FEATURE_TEXTURE_RECTANGLE;
|
||||
|
@ -91,7 +91,7 @@ _cogl_gles_update_features (CoglContext *context,
|
||||
flags |= COGL_FEATURE_DEPTH_RANGE;
|
||||
}
|
||||
|
||||
flags |= COGL_FEATURE_VBOS;
|
||||
private_flags |= COGL_PRIVATE_FEATURE_VBOS;
|
||||
|
||||
/* Both GLES 1.1 and GLES 2.0 support point sprites in core */
|
||||
flags |= COGL_FEATURE_POINT_SPRITE;
|
||||
|
Loading…
Reference in New Issue
Block a user