mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 13:54:16 +01:00
[dxvk] Remove unneeded atomic that holds base pipeline handles
No longer needed because the full pipeline object gets locked anyway.
This commit is contained in:
parent
a53e053391
commit
ec8559f40a
@ -48,7 +48,6 @@ namespace dxvk {
|
||||
|
||||
VkPipeline DxvkComputePipeline::getPipelineHandle(
|
||||
const DxvkComputePipelineStateInfo& state) {
|
||||
VkPipeline newPipelineBase = VK_NULL_HANDLE;
|
||||
VkPipeline newPipelineHandle = VK_NULL_HANDLE;
|
||||
|
||||
{ std::lock_guard<sync::Spinlock> lock(m_mutex);
|
||||
@ -58,17 +57,15 @@ namespace dxvk {
|
||||
|
||||
// If no pipeline instance exists with the given state
|
||||
// vector, create a new one and add it to the list.
|
||||
newPipelineBase = m_basePipeline.load();
|
||||
newPipelineHandle = this->compilePipeline(state, newPipelineBase);
|
||||
newPipelineHandle = this->compilePipeline(state, m_basePipeline);
|
||||
|
||||
// Add new pipeline to the set
|
||||
m_pipelines.push_back({ state, newPipelineHandle });
|
||||
m_pipeMgr->m_numComputePipelines += 1;
|
||||
|
||||
if (!m_basePipeline && newPipelineHandle)
|
||||
m_basePipeline = newPipelineHandle;
|
||||
}
|
||||
|
||||
// Use the new pipeline as the base pipeline for derivative pipelines
|
||||
if (newPipelineBase == VK_NULL_HANDLE && newPipelineHandle != VK_NULL_HANDLE)
|
||||
m_basePipeline.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
||||
|
||||
if (newPipelineHandle != VK_NULL_HANDLE)
|
||||
this->writePipelineStateToCache(state);
|
||||
|
@ -80,7 +80,7 @@ namespace dxvk {
|
||||
sync::Spinlock m_mutex;
|
||||
std::vector<PipelineStruct> m_pipelines;
|
||||
|
||||
std::atomic<VkPipeline> m_basePipeline = { VK_NULL_HANDLE };
|
||||
VkPipeline m_basePipeline = VK_NULL_HANDLE;
|
||||
|
||||
bool findPipeline(
|
||||
const DxvkComputePipelineStateInfo& state,
|
||||
|
@ -108,7 +108,6 @@ namespace dxvk {
|
||||
const DxvkRenderPass& renderPass) {
|
||||
VkRenderPass renderPassHandle = renderPass.getDefaultHandle();
|
||||
|
||||
VkPipeline newPipelineBase = VK_NULL_HANDLE;
|
||||
VkPipeline newPipelineHandle = VK_NULL_HANDLE;
|
||||
|
||||
{ std::lock_guard<sync::Spinlock> lock(m_mutex);
|
||||
@ -125,18 +124,16 @@ namespace dxvk {
|
||||
|
||||
// If no pipeline instance exists with the given state
|
||||
// vector, create a new one and add it to the list.
|
||||
newPipelineBase = m_basePipeline.load();
|
||||
newPipelineHandle = this->compilePipeline(state, renderPassHandle, newPipelineBase);
|
||||
newPipelineHandle = this->compilePipeline(state, renderPassHandle, m_basePipeline);
|
||||
|
||||
// Add new pipeline to the set
|
||||
m_pipelines.emplace_back(state, renderPassHandle, newPipelineHandle);
|
||||
m_pipeMgr->m_numGraphicsPipelines += 1;
|
||||
|
||||
if (!m_basePipeline && newPipelineHandle)
|
||||
m_basePipeline = newPipelineHandle;
|
||||
}
|
||||
|
||||
// Use the new pipeline as the base pipeline for derivative pipelines
|
||||
if (newPipelineBase == VK_NULL_HANDLE && newPipelineHandle != VK_NULL_HANDLE)
|
||||
m_basePipeline.compare_exchange_strong(newPipelineBase, newPipelineHandle);
|
||||
|
||||
if (newPipelineHandle != VK_NULL_HANDLE)
|
||||
this->writePipelineStateToCache(state, renderPass.format());
|
||||
|
||||
|
@ -239,7 +239,7 @@ namespace dxvk {
|
||||
std::vector<DxvkGraphicsPipelineInstance> m_pipelines;
|
||||
|
||||
// Pipeline handles used for derivative pipelines
|
||||
std::atomic<VkPipeline> m_basePipeline = { VK_NULL_HANDLE };
|
||||
VkPipeline m_basePipeline = VK_NULL_HANDLE;
|
||||
|
||||
const DxvkGraphicsPipelineInstance* findInstance(
|
||||
const DxvkGraphicsPipelineStateInfo& state,
|
||||
|
Loading…
x
Reference in New Issue
Block a user