Replace the disable-npots tool with a COGL_DEBUG option
Previously in the tests/tools directory we build a disable-npots library which was used as an LD_PRELOAD to trick Cogl in to thinking there is no NPOT texture extension. This is a little awkward to use so it seems much simpler to just define a COGL_DEBUG option to disable npot textures.
This commit is contained in:
parent
117ef6baff
commit
3203c2382f
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user