Skip to content

Commit

Permalink
vk: remove unnecessary flush and gc (#7207)
Browse files Browse the repository at this point in the history
  • Loading branch information
poweifeng authored Sep 26, 2023
1 parent 5a18cdf commit 864a854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions filament/backend/src/vulkan/VulkanDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion filament/backend/src/vulkan/VulkanSwapChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 864a854

Please sign in to comment.