From 2c1a44d885edec16c7dbe77a22028eb1cf61d05a Mon Sep 17 00:00:00 2001 From: korejan <64199710+korejan@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:32:55 +0100 Subject: [PATCH] c/util: fixes android crash with slow/multi-layer graphics based pipeline * Fixes crashes/vk validation errors when apps submit multiple layers or fast-path is explicitly disabled when using graphics based compositor pipeline * Switches the default compositor pipeline with android builds from compute back to graphics * Closes #381 * Does NOT fix #428 Thanks to @quic_yli25 for finding the issue. Part-of: --- src/xrt/compositor/main/comp_settings.c | 5 ----- src/xrt/compositor/util/comp_scratch.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/xrt/compositor/main/comp_settings.c b/src/xrt/compositor/main/comp_settings.c index 4b2106a7d..7aad08906 100644 --- a/src/xrt/compositor/main/comp_settings.c +++ b/src/xrt/compositor/main/comp_settings.c @@ -10,12 +10,7 @@ #include "util/u_debug.h" #include "comp_settings.h" -#ifdef XRT_OS_ANDROID -// temporary workaround for https://gitlab.freedesktop.org/monado/monado/-/issues/381 -#define USE_COMPUTE_DEFAULT true -#else #define USE_COMPUTE_DEFAULT false -#endif // clang-format off DEBUG_GET_ONCE_LOG_OPTION(log, "XRT_COMPOSITOR_LOG", U_LOGGING_INFO) diff --git a/src/xrt/compositor/util/comp_scratch.c b/src/xrt/compositor/util/comp_scratch.c index bab03a97d..48bfda7c7 100644 --- a/src/xrt/compositor/util/comp_scratch.c +++ b/src/xrt/compositor/util/comp_scratch.c @@ -165,7 +165,7 @@ tmp_init_and_create(struct tmp *t, struct vk_bundle *vk, const struct xrt_swapch const VkImageUsageFlags unorm_usage = VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; // Very few cards support SRGB storage. - const VkImageUsageFlags srgb_usage = VK_IMAGE_USAGE_SAMPLED_BIT; + const VkImageUsageFlags srgb_usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; const VkImageSubresourceRange subresource_range = { .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,