mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
Prevent rendering ownership change between command lists. (#1486)
Some checks are pending
validate-internal / build (push) Waiting to run
Some checks are pending
validate-internal / build (push) Waiting to run
This commit is contained in:
parent
49d3b675ed
commit
f5f92d0761
1 changed files with 8 additions and 0 deletions
|
|
@ -736,10 +736,13 @@ static void DestructTempResources()
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::thread::id g_presentThreadId = std::this_thread::get_id();
|
static std::thread::id g_presentThreadId = std::this_thread::get_id();
|
||||||
|
static std::atomic<bool> g_readyForCommands;
|
||||||
|
|
||||||
PPC_FUNC_IMPL(__imp__sub_824ECA00);
|
PPC_FUNC_IMPL(__imp__sub_824ECA00);
|
||||||
PPC_FUNC(sub_824ECA00)
|
PPC_FUNC(sub_824ECA00)
|
||||||
{
|
{
|
||||||
|
// Guard against thread ownership changes when between command lists.
|
||||||
|
g_readyForCommands.wait(false);
|
||||||
g_presentThreadId = std::this_thread::get_id();
|
g_presentThreadId = std::this_thread::get_id();
|
||||||
__imp__sub_824ECA00(ctx, base);
|
__imp__sub_824ECA00(ctx, base);
|
||||||
}
|
}
|
||||||
|
|
@ -1624,6 +1627,9 @@ static void BeginCommandList()
|
||||||
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 1);
|
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 1);
|
||||||
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 2);
|
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 2);
|
||||||
commandList->setGraphicsDescriptorSet(g_samplerDescriptorSet.get(), 3);
|
commandList->setGraphicsDescriptorSet(g_samplerDescriptorSet.get(), 3);
|
||||||
|
|
||||||
|
g_readyForCommands = true;
|
||||||
|
g_readyForCommands.notify_one();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
@ -2749,6 +2755,8 @@ static std::atomic<bool> g_executedCommandList;
|
||||||
|
|
||||||
void Video::Present()
|
void Video::Present()
|
||||||
{
|
{
|
||||||
|
g_readyForCommands = false;
|
||||||
|
|
||||||
RenderCommand cmd;
|
RenderCommand cmd;
|
||||||
cmd.type = RenderCommandType::ExecutePendingStretchRectCommands;
|
cmd.type = RenderCommandType::ExecutePendingStretchRectCommands;
|
||||||
g_renderQueue.enqueue(cmd);
|
g_renderQueue.enqueue(cmd);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue