mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Fix race condition requestCompileShader
This commit is contained in:
parent
a695644fea
commit
4869b0defa
@ -249,7 +249,7 @@ namespace dxvk {
|
|||||||
return &pair->second;
|
return &pair->second;
|
||||||
|
|
||||||
auto layout = createPipelineLayout(shaders.cs->getBindings());
|
auto layout = createPipelineLayout(shaders.cs->getBindings());
|
||||||
auto library = findPipelineLibrary(shaders.cs);
|
auto library = findPipelineLibraryLocked(shaders.cs);
|
||||||
|
|
||||||
auto iter = m_computePipelines.emplace(
|
auto iter = m_computePipelines.emplace(
|
||||||
std::piecewise_construct,
|
std::piecewise_construct,
|
||||||
@ -291,8 +291,8 @@ namespace dxvk {
|
|||||||
DxvkShaderPipelineLibrary* fsLibrary = nullptr;
|
DxvkShaderPipelineLibrary* fsLibrary = nullptr;
|
||||||
|
|
||||||
if (shaders.tcs == nullptr && shaders.tes == nullptr && shaders.gs == nullptr) {
|
if (shaders.tcs == nullptr && shaders.tes == nullptr && shaders.gs == nullptr) {
|
||||||
vsLibrary = findPipelineLibrary(shaders.vs);
|
vsLibrary = findPipelineLibraryLocked(shaders.vs);
|
||||||
fsLibrary = findPipelineLibrary(shaders.fs);
|
fsLibrary = findPipelineLibraryLocked(shaders.fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto iter = m_graphicsPipelines.emplace(
|
auto iter = m_graphicsPipelines.emplace(
|
||||||
@ -445,6 +445,13 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibrary(
|
DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibrary(
|
||||||
|
const Rc<DxvkShader>& shader) {
|
||||||
|
std::lock_guard<dxvk::mutex> lock(m_mutex);
|
||||||
|
return findPipelineLibraryLocked(shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibraryLocked(
|
||||||
const Rc<DxvkShader>& shader) {
|
const Rc<DxvkShader>& shader) {
|
||||||
DxvkShaderPipelineLibraryKey key;
|
DxvkShaderPipelineLibraryKey key;
|
||||||
key.shader = shader;
|
key.shader = shader;
|
||||||
|
@ -302,6 +302,9 @@ namespace dxvk {
|
|||||||
DxvkShaderPipelineLibrary* findPipelineLibrary(
|
DxvkShaderPipelineLibrary* findPipelineLibrary(
|
||||||
const Rc<DxvkShader>& shader);
|
const Rc<DxvkShader>& shader);
|
||||||
|
|
||||||
|
DxvkShaderPipelineLibrary* findPipelineLibraryLocked(
|
||||||
|
const Rc<DxvkShader>& shader);
|
||||||
|
|
||||||
bool canPrecompileShader(
|
bool canPrecompileShader(
|
||||||
const Rc<DxvkShader>& shader) const;
|
const Rc<DxvkShader>& shader) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user