vk_pipeline_cache: Reduce flickering on android
This commit is contained in:
@ -137,16 +137,23 @@ PipelineCache::GraphicsPipeline::~GraphicsPipeline() {
|
|||||||
|
|
||||||
bool PipelineCache::GraphicsPipeline::Build(bool fail_on_compile_required) {
|
bool PipelineCache::GraphicsPipeline::Build(bool fail_on_compile_required) {
|
||||||
if (fail_on_compile_required) {
|
if (fail_on_compile_required) {
|
||||||
if (!instance.IsPipelineCreationCacheControlSupported()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if all shader modules are ready
|
// Check if all shader modules are ready
|
||||||
for (auto& shader : stages) {
|
for (auto& shader : stages) {
|
||||||
if (shader && !shader->IsBuilt()) {
|
if (shader && !shader->IsBuilt()) {
|
||||||
return false;
|
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);
|
MICROPROFILE_SCOPE(Vulkan_Pipeline);
|
||||||
|
Reference in New Issue
Block a user