From 96effa46e40be245a6b7c3a4f8be7ef1883e62d0 Mon Sep 17 00:00:00 2001 From: GPUCode Date: Sat, 11 Feb 2023 13:17:32 +0200 Subject: [PATCH] vk_pipeline_cache: Reduce flickering on android --- .../renderer_vulkan/vk_pipeline_cache.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 0596d876c..970e63f4a 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -137,16 +137,23 @@ PipelineCache::GraphicsPipeline::~GraphicsPipeline() { bool PipelineCache::GraphicsPipeline::Build(bool fail_on_compile_required) { if (fail_on_compile_required) { - if (!instance.IsPipelineCreationCacheControlSupported()) { - return false; - } - // Check if all shader modules are ready for (auto& shader : stages) { if (shader && !shader->IsBuilt()) { return false; } } + + if (!instance.IsPipelineCreationCacheControlSupported()) { +#if ANDROID + // Many android devices do not support the above extension. + // To avoid having lots of flickering, if all shaders are + // ready compile the pipeline anyway. + return Build(); +#else + return false; +#endif + } } MICROPROFILE_SCOPE(Vulkan_Pipeline);