mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 20:31:41 +00:00
Fix pipelines getting dropped.
This commit is contained in:
parent
6f313ed5a8
commit
f1eb4992ab
1 changed files with 3 additions and 8 deletions
|
|
@ -4298,22 +4298,17 @@ static void CreateGraphicsPipelineInPipelineThread(const PipelineState& pipeline
|
|||
{
|
||||
XXH64_hash_t hash = XXH3_64bits(&pipelineState, sizeof(pipelineState));
|
||||
|
||||
bool found = false;
|
||||
bool shouldCompile = false;
|
||||
{
|
||||
std::lock_guard lock(g_asyncPipelineMutex);
|
||||
found = g_asyncPipelines.contains(hash);
|
||||
shouldCompile = g_asyncPipelines.emplace(hash).second;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (shouldCompile)
|
||||
{
|
||||
auto pipeline = CreateGraphicsPipeline(pipelineState);
|
||||
pipeline->setName(std::format("Async Pipeline {:X}", hash));
|
||||
|
||||
{
|
||||
std::lock_guard lock(g_asyncPipelineMutex);
|
||||
g_asyncPipelines.emplace(hash);
|
||||
}
|
||||
|
||||
// Will get dropped in render thread if a different thread already managed to compile this.
|
||||
RenderCommand cmd;
|
||||
cmd.type = RenderCommandType::AddPipeline;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue