1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 22:54:16 +01:00

[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.
This commit is contained in:
Philip Rebohle 2018-09-21 19:13:24 +02:00
parent 0e2d63f6d2
commit d6742e38c5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -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<sync::Spinlock> lock(m_mutex);
newPipelineHandle = this->compilePipeline(
state, renderPassHandle, newPipelineBase);
}
{ std::lock_guard<sync::Spinlock> lock(m_mutex);
// Discard the pipeline if another thread