vk: remove unnecessary flush and gc (#7207)

This commit is contained in:
Powei Feng
2023-09-26 14:05:36 -07:00
committed by GitHub
parent 5a18cdf0f6
commit 864a854c13
2 changed files with 6 additions and 8 deletions

View File

@@ -290,9 +290,11 @@ void VulkanDriver::setPresentationTime(int64_t monotonic_clock_ns) {
}
void VulkanDriver::endFrame(uint32_t frameId) {
if (mCommands->flush()) {
collectGarbage();
}
FVK_SYSTRACE_CONTEXT();
FVK_SYSTRACE_START("endframe");
mCommands->flush();
collectGarbage();
FVK_SYSTRACE_END();
}
void VulkanDriver::flush(int) {
@@ -1370,10 +1372,6 @@ void VulkanDriver::commit(Handle<HwSwapChain> sch) {
VulkanSwapChain* swapChain = mResourceAllocator.handle_cast<VulkanSwapChain*>(sch);
if (mCommands->flush()) {
collectGarbage();
}
// Present the backbuffer after the most recent command buffer submission has finished.
swapChain->present();
FVK_SYSTRACE_END();

View File

@@ -88,8 +88,8 @@ void VulkanSwapChain::present() {
.layerCount = 1,
};
mColors[mCurrentSwapIndex]->transitionLayout(cmdbuf, subresources, VulkanLayout::PRESENT);
mCommands->flush();
}
mCommands->flush();
VkSemaphore const finishedDrawing = mCommands->acquireFinishedSignal();
VkResult const result = mPlatform->present(swapChain, mCurrentSwapIndex, finishedDrawing);
ASSERT_POSTCONDITION(result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR