Add a COGL_DEBUG option to disable the fixed function pipeline backend

This adds COGL_DEBUG=disable-fixed to disable the fixed function
pipeline backend. This is needed to test the GLSL shader generation
because otherwise the fixed function backend would always override it.
This commit is contained in:
Neil Roberts 2010-11-24 17:29:00 +00:00
parent 577d65c2c9
commit d19f6212ce
4 changed files with 17 additions and 7 deletions

View File

@ -122,6 +122,11 @@ OPT (DISABLE_ARBFP,
"disable-arbfp", "disable-arbfp",
"Disable arbfp", "Disable arbfp",
"Disable use of ARB fragment programs") "Disable use of ARB fragment programs")
OPT (DISABLE_FIXED,
"Root Cause",
"disable-fixed",
"Disable fixed",
"Disable use of the fixed function pipeline backend")
OPT (DISABLE_GLSL, OPT (DISABLE_GLSL,
"Root Cause", "Root Cause",
"disable-glsl", "disable-glsl",

View File

@ -68,6 +68,7 @@ static const GDebugKey cogl_behavioural_debug_keys[] = {
{ "disable-atlas", COGL_DEBUG_DISABLE_ATLAS }, { "disable-atlas", COGL_DEBUG_DISABLE_ATLAS },
{ "disable-texturing", COGL_DEBUG_DISABLE_TEXTURING}, { "disable-texturing", COGL_DEBUG_DISABLE_TEXTURING},
{ "disable-arbfp", COGL_DEBUG_DISABLE_ARBFP}, { "disable-arbfp", COGL_DEBUG_DISABLE_ARBFP},
{ "disable-fixed", COGL_DEBUG_DISABLE_FIXED},
{ "disable-glsl", COGL_DEBUG_DISABLE_GLSL}, { "disable-glsl", COGL_DEBUG_DISABLE_GLSL},
{ "disable-blending", COGL_DEBUG_DISABLE_BLENDING}, { "disable-blending", COGL_DEBUG_DISABLE_BLENDING},
{ "disable-npot-textures", COGL_DEBUG_DISABLE_NPOT_TEXTURES}, { "disable-npot-textures", COGL_DEBUG_DISABLE_NPOT_TEXTURES},

View File

@ -51,13 +51,14 @@ typedef enum {
COGL_DEBUG_OPENGL = 1 << 18, COGL_DEBUG_OPENGL = 1 << 18,
COGL_DEBUG_DISABLE_TEXTURING = 1 << 19, COGL_DEBUG_DISABLE_TEXTURING = 1 << 19,
COGL_DEBUG_DISABLE_ARBFP = 1 << 20, COGL_DEBUG_DISABLE_ARBFP = 1 << 20,
COGL_DEBUG_DISABLE_GLSL = 1 << 21, COGL_DEBUG_DISABLE_FIXED = 1 << 21,
COGL_DEBUG_SHOW_SOURCE = 1 << 22, COGL_DEBUG_DISABLE_GLSL = 1 << 22,
COGL_DEBUG_DISABLE_BLENDING = 1 << 23, COGL_DEBUG_SHOW_SOURCE = 1 << 23,
COGL_DEBUG_TEXTURE_PIXMAP = 1 << 24, COGL_DEBUG_DISABLE_BLENDING = 1 << 24,
COGL_DEBUG_BITMAP = 1 << 25, COGL_DEBUG_TEXTURE_PIXMAP = 1 << 25,
COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 26, COGL_DEBUG_BITMAP = 1 << 26,
COGL_DEBUG_WIREFRAME = 1 << 27 COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 27,
COGL_DEBUG_WIREFRAME = 1 << 28
} CoglDebugFlags; } CoglDebugFlags;
#ifdef COGL_ENABLE_DEBUG #ifdef COGL_ENABLE_DEBUG

View File

@ -74,6 +74,9 @@ _cogl_pipeline_backend_fixed_start (CoglPipeline *pipeline,
{ {
CoglHandle user_program; CoglHandle user_program;
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_FIXED))
return FALSE;
user_program = cogl_pipeline_get_user_program (pipeline); user_program = cogl_pipeline_get_user_program (pipeline);
if (user_program != COGL_INVALID_HANDLE) if (user_program != COGL_INVALID_HANDLE)
return FALSE; return FALSE;