mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Submit main command buffer before acquire. Fix sync bug.
This commit is contained in:
parent
fff080202f
commit
f6cb6c7695
2 changed files with 7 additions and 4 deletions
|
@ -126,16 +126,16 @@ void FrameData::SubmitPending(VulkanContext *vulkan, FrameSubmitType type, Frame
|
|||
hasInitCommands = false;
|
||||
}
|
||||
|
||||
if ((hasMainCommands || hasPresentCommands) && type == FrameSubmitType::Sync) {
|
||||
fenceToTrigger = readbackFence;
|
||||
}
|
||||
|
||||
if (hasMainCommands) {
|
||||
VkResult res = vkEndCommandBuffer(mainCmd);
|
||||
_assert_msg_(res == VK_SUCCESS, "vkEndCommandBuffer failed (main)! result=%s", VulkanResultToString(res));
|
||||
|
||||
cmdBufs[numCmdBufs++] = mainCmd;
|
||||
hasMainCommands = false;
|
||||
|
||||
if (type == FrameSubmitType::Sync) {
|
||||
fenceToTrigger = readbackFence;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPresentCommands) {
|
||||
|
|
|
@ -563,6 +563,8 @@ void VulkanQueueRunner::RunSteps(FrameData &frameData, FrameDataShared &frameDat
|
|||
switch (step.stepType) {
|
||||
case VKRStepType::RENDER:
|
||||
if (!step.render.framebuffer) {
|
||||
frameData.SubmitPending(vulkan_, FrameSubmitType::Pending, frameDataShared);
|
||||
|
||||
// When stepping in the GE debugger, we can end up here multiple times in a "frame".
|
||||
// So only acquire once.
|
||||
if (!frameData.hasAcquired) {
|
||||
|
@ -570,6 +572,7 @@ void VulkanQueueRunner::RunSteps(FrameData &frameData, FrameDataShared &frameDat
|
|||
SetBackbuffer(framebuffers_[frameData.curSwapchainImage], swapchainImages_[frameData.curSwapchainImage].image);
|
||||
}
|
||||
|
||||
_dbg_assert_(!frameData.hasPresentCommands);
|
||||
// A RENDER step rendering to the backbuffer is normally the last step that happens in a frame,
|
||||
// unless taking a screenshot, in which case there might be a READBACK_IMAGE after it.
|
||||
// This is why we have to switch cmd to presentCmd, in this case.
|
||||
|
|
Loading…
Add table
Reference in a new issue