summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cogl/cogl-debug-options.h6
-rw-r--r--cogl/cogl-debug.c3
-rw-r--r--cogl/cogl-debug.h3
-rw-r--r--cogl/cogl.c6
4 files changed, 16 insertions, 2 deletions
diff --git a/cogl/cogl-debug-options.h b/cogl/cogl-debug-options.h
index a73d7e1f..1c0bd5be 100644
--- a/cogl/cogl-debug-options.h
+++ b/cogl/cogl-debug-options.h
@@ -127,6 +127,12 @@ OPT (DISABLE_BLENDING,
"disable-blending",
"Disable blending",
"Disable use of blending")
+OPT (DISABLE_NPOT_TEXTURES,
+ "Root Cause",
+ "disable-npot-textures",
+ "Disable non-power-of-two textures",
+ "Makes Cogl think that the GL driver doesn't support NPOT textures "
+ "so that it will create sliced textures or textures with waste instead.")
OPT (SHOW_SOURCE,
"Cogl Tracing",
"show-source",
diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c
index 99049a6e..94c276a9 100644
--- a/cogl/cogl-debug.c
+++ b/cogl/cogl-debug.c
@@ -69,7 +69,8 @@ static const GDebugKey cogl_behavioural_debug_keys[] = {
{ "disable-texturing", COGL_DEBUG_DISABLE_TEXTURING},
{ "disable-arbfp", COGL_DEBUG_DISABLE_ARBFP},
{ "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}
};
static const int n_cogl_behavioural_debug_keys =
G_N_ELEMENTS (cogl_behavioural_debug_keys);
diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h
index e9029afb..9a390b4a 100644
--- a/cogl/cogl-debug.h
+++ b/cogl/cogl-debug.h
@@ -55,7 +55,8 @@ typedef enum {
COGL_DEBUG_SHOW_SOURCE = 1 << 22,
COGL_DEBUG_DISABLE_BLENDING = 1 << 23,
COGL_DEBUG_TEXTURE_PIXMAP = 1 << 24,
- COGL_DEBUG_BITMAP = 1 << 25
+ COGL_DEBUG_BITMAP = 1 << 25,
+ COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 26
} CoglDebugFlags;
#ifdef COGL_ENABLE_DEBUG
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 9f35468a..e21b088b 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -444,6 +444,12 @@ cogl_get_features (void)
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_GLSL))
ctx->feature_flags &= ~COGL_FEATURE_SHADERS_GLSL;
+ if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_NPOT_TEXTURES))
+ ctx->feature_flags &= ~(COGL_FEATURE_TEXTURE_NPOT |
+ COGL_FEATURE_TEXTURE_NPOT_BASIC |
+ COGL_FEATURE_TEXTURE_NPOT_MIPMAP |
+ COGL_FEATURE_TEXTURE_NPOT_REPEAT);
+
return ctx->feature_flags;
}