mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 12:51:42 +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));
|
XXH64_hash_t hash = XXH3_64bits(&pipelineState, sizeof(pipelineState));
|
||||||
|
|
||||||
bool found = false;
|
bool shouldCompile = false;
|
||||||
{
|
{
|
||||||
std::lock_guard lock(g_asyncPipelineMutex);
|
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);
|
auto pipeline = CreateGraphicsPipeline(pipelineState);
|
||||||
pipeline->setName(std::format("Async Pipeline {:X}", hash));
|
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.
|
// Will get dropped in render thread if a different thread already managed to compile this.
|
||||||
RenderCommand cmd;
|
RenderCommand cmd;
|
||||||
cmd.type = RenderCommandType::AddPipeline;
|
cmd.type = RenderCommandType::AddPipeline;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue