From d6742e38c5c1b8870fb26532207341e2a0e5167f Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 21 Sep 2018 19:13:24 +0200 Subject: [PATCH] [dxvk] Lock pipeline object while compiling one pipeline This prevents us from compiling the exact same pipeline twice at the same time, which for some reason crashes RADV. --- src/dxvk/dxvk_graphics.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index a177aa27..8aebd0d9 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -102,9 +102,15 @@ namespace dxvk { // If no pipeline instance exists with the given state // vector, create a new one and add it to the list. VkPipeline newPipelineBase = m_basePipeline.load(); - VkPipeline newPipelineHandle = this->compilePipeline( - state, renderPassHandle, newPipelineBase); + VkPipeline newPipelineHandle = VK_NULL_HANDLE; + // FIXME for some reason, compiling the exact + // same pipeline crashes inside driver code + { std::lock_guard lock(m_mutex); + newPipelineHandle = this->compilePipeline( + state, renderPassHandle, newPipelineBase); + } + { std::lock_guard lock(m_mutex); // Discard the pipeline if another thread