gpu: Add GSK_DEBUG=occlusion

Draws a semi-transparent white overlay over all regions that have
been chosen for occlusion.
This commit is contained in:
Benjamin Otte 2024-08-05 22:11:22 +02:00
parent afa4eb7d35
commit e9944148d5
3 changed files with 13 additions and 0 deletions

View File

@ -4101,6 +4101,17 @@ gsk_gpu_node_processor_render (GskGpuFrame *frame,
gsk_gpu_node_processor_add_node (&self, node);
do_culling = FALSE;
}
else if (GSK_DEBUG_CHECK (OCCLUSION))
{
gsk_gpu_node_processor_sync_globals (&self, 0);
gsk_gpu_color_op (self.frame,
GSK_GPU_SHADER_CLIP_NONE,
self.ccs,
1.0,
&self.offset,
&GRAPHENE_RECT_INIT(0, 0, 10000, 10000),
&GDK_COLOR_SRGB (1.0, 1.0, 1.0, 0.6));
}
gsk_gpu_render_pass_end_op (frame,
target,

View File

@ -15,6 +15,7 @@ static const GdkDebugKey gsk_debug_keys[] = {
{ "staging", GSK_DEBUG_STAGING, "Use a staging image for texture upload (Vulkan only)" },
{ "offload-disable", GSK_DEBUG_OFFLOAD_DISABLE, "Disable graphics offload" },
{ "cairo", GSK_DEBUG_CAIRO, "Overlay error pattern over Cairo drawing (finds fallbacks)" },
{ "occlusion", GSK_DEBUG_OCCLUSION, "Overlay highlight over areas optimized via occlusion culling" },
};
static guint gsk_debug_flags;

View File

@ -18,6 +18,7 @@ typedef enum {
GSK_DEBUG_STAGING = 1 << 10,
GSK_DEBUG_OFFLOAD_DISABLE = 1 << 11,
GSK_DEBUG_CAIRO = 1 << 12,
GSK_DEBUG_OCCLUSION = 1 << 13,
} GskDebugFlags;
#define GSK_DEBUG_ANY ((1 << 13) - 1)