mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[dxvk] Fix base pipeline assignment when compipling new pipelines
We might otherwise end up destroying our base pipeline.
This commit is contained in:
parent
50dfab2797
commit
18b39d8239
@ -168,14 +168,14 @@ namespace dxvk {
|
|||||||
instance->m_stateVector, instance->m_renderPass,
|
instance->m_stateVector, instance->m_renderPass,
|
||||||
0, m_fastPipelineBase);
|
0, m_fastPipelineBase);
|
||||||
|
|
||||||
// Use the new pipeline as the base pipeline for derivative pipelines
|
if (!instance->setFastPipeline(newPipelineHandle)) {
|
||||||
if (newPipelineBase == VK_NULL_HANDLE && newPipelineHandle != VK_NULL_HANDLE)
|
// If another thread finished compiling an optimized version of this
|
||||||
m_fastPipelineBase.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
// pipeline before this one finished, discard the new pipeline object.
|
||||||
|
|
||||||
// If an optimized version has been compiled
|
|
||||||
// in the meantime, discard the new pipeline
|
|
||||||
if (!instance->setFastPipeline(newPipelineHandle))
|
|
||||||
m_vkd->vkDestroyPipeline(m_vkd->device(), newPipelineHandle, nullptr);
|
m_vkd->vkDestroyPipeline(m_vkd->device(), newPipelineHandle, nullptr);
|
||||||
|
} else if (newPipelineBase == VK_NULL_HANDLE && newPipelineHandle != VK_NULL_HANDLE) {
|
||||||
|
// Use the new pipeline as the base pipeline for derivative pipelines.
|
||||||
|
m_fastPipelineBase.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user