From 06eebfb06f1e99a161fc9a620ca7692f6537e084 Mon Sep 17 00:00:00 2001 From: Korcan Hussein Date: Mon, 20 May 2024 16:10:11 +0100 Subject: [PATCH] c/util: Fixes crash bug when zero layers are committed Fixes crash in `render_gfx_end_target` with non-compute pipeline path on android (possibly any platform) when zero layers are committed. --- src/xrt/compositor/util/comp_render_gfx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xrt/compositor/util/comp_render_gfx.c b/src/xrt/compositor/util/comp_render_gfx.c index 0b4407213..666b3d8f2 100644 --- a/src/xrt/compositor/util/comp_render_gfx.c +++ b/src/xrt/compositor/util/comp_render_gfx.c @@ -840,6 +840,14 @@ comp_render_gfx_dispatch(struct render_gfx *rr, layer, // vds); // + } else if (layer_count == 0) { + // Just clear the screen + render_gfx_begin_target( // + rr, // + d->gfx.rtr, // + &background_color_idle); // + + render_gfx_end_target(rr); } else { if (fast_path) { U_LOG_W("Wanted fast path but no projection layer, falling back to layer squasher.");