diff --git a/src/dxvk/dxvk_pipemanager.cpp b/src/dxvk/dxvk_pipemanager.cpp index 8004f2089..76ad41e9a 100644 --- a/src/dxvk/dxvk_pipemanager.cpp +++ b/src/dxvk/dxvk_pipemanager.cpp @@ -249,7 +249,7 @@ namespace dxvk { return &pair->second; auto layout = createPipelineLayout(shaders.cs->getBindings()); - auto library = findPipelineLibrary(shaders.cs); + auto library = findPipelineLibraryLocked(shaders.cs); auto iter = m_computePipelines.emplace( std::piecewise_construct, @@ -291,8 +291,8 @@ namespace dxvk { DxvkShaderPipelineLibrary* fsLibrary = nullptr; if (shaders.tcs == nullptr && shaders.tes == nullptr && shaders.gs == nullptr) { - vsLibrary = findPipelineLibrary(shaders.vs); - fsLibrary = findPipelineLibrary(shaders.fs); + vsLibrary = findPipelineLibraryLocked(shaders.vs); + fsLibrary = findPipelineLibraryLocked(shaders.fs); } auto iter = m_graphicsPipelines.emplace( @@ -445,6 +445,13 @@ namespace dxvk { DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibrary( + const Rc& shader) { + std::lock_guard lock(m_mutex); + return findPipelineLibraryLocked(shader); + } + + + DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibraryLocked( const Rc& shader) { DxvkShaderPipelineLibraryKey key; key.shader = shader; diff --git a/src/dxvk/dxvk_pipemanager.h b/src/dxvk/dxvk_pipemanager.h index b71751dde..b43e12cc8 100644 --- a/src/dxvk/dxvk_pipemanager.h +++ b/src/dxvk/dxvk_pipemanager.h @@ -302,6 +302,9 @@ namespace dxvk { DxvkShaderPipelineLibrary* findPipelineLibrary( const Rc& shader); + DxvkShaderPipelineLibrary* findPipelineLibraryLocked( + const Rc& shader); + bool canPrecompileShader( const Rc& shader) const;