diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index c12fbbf5b..4db96f370 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -74,18 +74,20 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, RenderpassCache& r GraphicsPipeline::~GraphicsPipeline() = default; bool GraphicsPipeline::TryBuild(bool wait_built) { + // The pipeline is currently being compiled. We can either wait for it + // or skip the draw. if (is_pending) { - return true; + return wait_built; } - // If the shaders haven't been compiled yet, we cannot proceed + // If the shaders haven't been compiled yet, we cannot proceed. const bool shaders_pending = std::any_of( stages.begin(), stages.end(), [](Shader* shader) { return shader && !shader->IsDone(); }); if (!wait_built && shaders_pending) { return false; } - // Ask the driver if it can give us the pipeline quickly + // Ask the driver if it can give us the pipeline quickly. if (!wait_built && instance.IsPipelineCreationCacheControlSupported() && Build(true)) { return true; } @@ -93,7 +95,7 @@ bool GraphicsPipeline::TryBuild(bool wait_built) { // Fallback to (a)synchronous compilation worker->QueueWork([this] { Build(); }); is_pending = true; - return true; + return wait_built; } bool GraphicsPipeline::Build(bool fail_on_compile_required) {