debug: Adds a COGL_DEBUG=disable-pbos debug option

For testing purposes, either to identify bugs in Cogl or the driver or
simulate lack of PBO support COGL_DEBUG=disable-pbos can be used to
fallback to malloc instead.
This commit is contained in:
Robert Bragg 2010-07-06 01:30:25 +01:00
parent b4b98358e1
commit 739240095f
3 changed files with 10 additions and 4 deletions

View File

@ -61,6 +61,7 @@ static const GDebugKey cogl_behavioural_debug_keys[] = {
{ "rectangles", COGL_DEBUG_RECTANGLES },
{ "disable-batching", COGL_DEBUG_DISABLE_BATCHING },
{ "disable-vbos", COGL_DEBUG_DISABLE_VBOS },
{ "disable-pbos", COGL_DEBUG_DISABLE_PBOS },
{ "disable-software-transform", COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM },
{ "dump-atlas-image", COGL_DEBUG_DUMP_ATLAS_IMAGE },
{ "disable-atlas", COGL_DEBUG_DISABLE_ATLAS },
@ -117,6 +118,7 @@ _cogl_parse_debug_string (const char *value,
OPT ("rectangles:", "add wire outlines for all rectangular geometry");
OPT ("disable-batching:", "disable the journal batching");
OPT ("disable-vbos:", "disable use of OpenGL vertex buffer objects");
OPT ("disable-pbos:", "disable use of OpenGL pixel buffer objects");
OPT ("disable-software-transform",
"use the GPU to transform rectangular geometry");
OPT ("dump-atlas-image:", "dump atlas changes to an image file");

View File

@ -38,10 +38,11 @@ typedef enum {
COGL_DEBUG_BLEND_STRINGS = 1 << 7,
COGL_DEBUG_DISABLE_BATCHING = 1 << 8,
COGL_DEBUG_DISABLE_VBOS = 1 << 9,
COGL_DEBUG_JOURNAL = 1 << 10,
COGL_DEBUG_BATCHING = 1 << 11,
COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM = 1 << 12,
COGL_DEBUG_MATRICES = 1 << 13,
COGL_DEBUG_DISABLE_PBOS = 1 << 10,
COGL_DEBUG_JOURNAL = 1 << 11,
COGL_DEBUG_BATCHING = 1 << 12,
COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM = 1 << 13,
COGL_DEBUG_MATRICES = 1 << 14,
COGL_DEBUG_ATLAS = 1 << 15,
COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 16,
COGL_DEBUG_DISABLE_ATLAS = 1 << 17,

View File

@ -492,6 +492,9 @@ cogl_get_features (void)
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_VBOS))
ctx->feature_flags &= ~COGL_FEATURE_VBOS;
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_PBOS))
ctx->feature_flags &= ~COGL_FEATURE_PBOS;
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_GLSL))
ctx->feature_flags &= ~COGL_FEATURE_SHADERS_GLSL;