mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
Add a COGL_DEBUG option to disable software clipping
This adds a debug option called disable-software-clipping which causes the journal to always log the clip stack state rather than trying to manually clip rectangles.
This commit is contained in:
parent
62c893feee
commit
3fa91efea8
@ -143,6 +143,11 @@ OPT (DISABLE_NPOT_TEXTURES,
|
|||||||
"Disable non-power-of-two textures",
|
"Disable non-power-of-two textures",
|
||||||
"Makes Cogl think that the GL driver doesn't support NPOT 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.")
|
"so that it will create sliced textures or textures with waste instead.")
|
||||||
|
OPT (DISABLE_SOFTWARE_CLIP,
|
||||||
|
"Root Cause",
|
||||||
|
"disable-software-clip",
|
||||||
|
"Disable software clipping",
|
||||||
|
"Disables Cogl's attempts to clip some rectangles in software.")
|
||||||
OPT (SHOW_SOURCE,
|
OPT (SHOW_SOURCE,
|
||||||
"Cogl Tracing",
|
"Cogl Tracing",
|
||||||
"show-source",
|
"show-source",
|
||||||
|
@ -72,7 +72,8 @@ static const GDebugKey cogl_behavioural_debug_keys[] = {
|
|||||||
{ "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},
|
||||||
{ "wireframe", COGL_DEBUG_WIREFRAME}
|
{ "wireframe", COGL_DEBUG_WIREFRAME},
|
||||||
|
{ "disable-software-clip", COGL_DEBUG_DISABLE_SOFTWARE_CLIP}
|
||||||
};
|
};
|
||||||
static const int n_cogl_behavioural_debug_keys =
|
static const int n_cogl_behavioural_debug_keys =
|
||||||
G_N_ELEMENTS (cogl_behavioural_debug_keys);
|
G_N_ELEMENTS (cogl_behavioural_debug_keys);
|
||||||
|
@ -58,7 +58,8 @@ typedef enum {
|
|||||||
COGL_DEBUG_TEXTURE_PIXMAP = 1 << 25,
|
COGL_DEBUG_TEXTURE_PIXMAP = 1 << 25,
|
||||||
COGL_DEBUG_BITMAP = 1 << 26,
|
COGL_DEBUG_BITMAP = 1 << 26,
|
||||||
COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 27,
|
COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 27,
|
||||||
COGL_DEBUG_WIREFRAME = 1 << 28
|
COGL_DEBUG_WIREFRAME = 1 << 28,
|
||||||
|
COGL_DEBUG_DISABLE_SOFTWARE_CLIP = 1 << 29
|
||||||
} CoglDebugFlags;
|
} CoglDebugFlags;
|
||||||
|
|
||||||
#ifdef COGL_ENABLE_DEBUG
|
#ifdef COGL_ENABLE_DEBUG
|
||||||
|
@ -1155,16 +1155,19 @@ _cogl_journal_flush (void)
|
|||||||
state.modelview_stack = modelview_stack;
|
state.modelview_stack = modelview_stack;
|
||||||
state.projection_stack = _cogl_framebuffer_get_projection_stack (framebuffer);
|
state.projection_stack = _cogl_framebuffer_get_projection_stack (framebuffer);
|
||||||
|
|
||||||
/* We do an initial walk of the journal to analyse the clip stack
|
if (G_UNLIKELY ((cogl_debug_flags & COGL_DEBUG_DISABLE_SOFTWARE_CLIP) == 0))
|
||||||
batches to see if we can do software clipping. We do this as a
|
{
|
||||||
separate walk of the journal because we can modify entries and
|
/* We do an initial walk of the journal to analyse the clip stack
|
||||||
this may end up joining together clip stack batches in the next
|
batches to see if we can do software clipping. We do this as a
|
||||||
iteration. */
|
separate walk of the journal because we can modify entries and
|
||||||
batch_and_call ((CoglJournalEntry *)ctx->journal->data, /* first entry */
|
this may end up joining together clip stack batches in the next
|
||||||
ctx->journal->len, /* max number of entries to consider */
|
iteration. */
|
||||||
compare_entry_clip_stacks,
|
batch_and_call ((CoglJournalEntry *)ctx->journal->data, /* first entry */
|
||||||
_cogl_journal_check_software_clip, /* callback */
|
ctx->journal->len, /* max number of entries to consider */
|
||||||
&state); /* data */
|
compare_entry_clip_stacks,
|
||||||
|
_cogl_journal_check_software_clip, /* callback */
|
||||||
|
&state); /* data */
|
||||||
|
}
|
||||||
|
|
||||||
/* We upload the vertices after the clip stack pass in case it
|
/* We upload the vertices after the clip stack pass in case it
|
||||||
modifies the entries */
|
modifies the entries */
|
||||||
|
Loading…
Reference in New Issue
Block a user