From 3ea7816499996c3bb918b27c6f44c987b90d2e9c Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 17 Jun 2009 01:46:06 +0100 Subject: [PATCH] [cogl] Adds a debug option for disabling use of VBOs --cogl-debug=disable-vbos For testing the VBO fallback paths it helps to be able to disable the COGL_FEATURE_VBOS feature flag. When VBOs aren't available Cogl should use client side malloc()'d buffers instead. --- clutter/cogl/cogl-debug.h | 3 ++- clutter/cogl/common/cogl-debug.c | 3 ++- clutter/cogl/common/cogl.c | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl-debug.h b/clutter/cogl/cogl-debug.h index c67f37568..44fd1c5de 100644 --- a/clutter/cogl/cogl-debug.h +++ b/clutter/cogl/cogl-debug.h @@ -40,7 +40,8 @@ typedef enum { COGL_DEBUG_HANDLE = 1 << 8, COGL_DEBUG_BLEND_STRINGS = 1 << 9, COGL_DEBUG_DISABLE_BATCHING = 1 << 10, - COGL_DEBUG_FORCE_CLIENT_SIDE_MATRICES = 1 << 11 + COGL_DEBUG_FORCE_CLIENT_SIDE_MATRICES = 1 << 11, + COGL_DEBUG_DISABLE_VBOS = 1 << 12 } CoglDebugFlags; #ifdef COGL_ENABLE_DEBUG diff --git a/clutter/cogl/common/cogl-debug.c b/clutter/cogl/common/cogl-debug.c index 53236cdbe..70f21d28b 100644 --- a/clutter/cogl/common/cogl-debug.c +++ b/clutter/cogl/common/cogl-debug.c @@ -42,7 +42,8 @@ static const GDebugKey cogl_debug_keys[] = { { "handle", COGL_DEBUG_HANDLE }, { "blend-strings", COGL_DEBUG_BLEND_STRINGS }, { "disable-batching", COGL_DEBUG_DISABLE_BATCHING }, - { "client-side-matrices", COGL_DEBUG_FORCE_CLIENT_SIDE_MATRICES } + { "client-side-matrices", COGL_DEBUG_FORCE_CLIENT_SIDE_MATRICES }, + { "disable-vbos", COGL_DEBUG_DISABLE_VBOS } }; static const gint n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys); diff --git a/clutter/cogl/common/cogl.c b/clutter/cogl/common/cogl.c index 944ff8d68..29366b335 100644 --- a/clutter/cogl/common/cogl.c +++ b/clutter/cogl/common/cogl.c @@ -574,6 +574,9 @@ cogl_get_features (void) if (!ctx->features_cached) _cogl_features_init (); + if (cogl_debug_flags & COGL_DEBUG_DISABLE_VBOS) + ctx->feature_flags &= ~COGL_FEATURE_VBOS; + return ctx->feature_flags; }