mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-25 12:02:23 +03:00
feat: nescapture pacing, improvements and deps update (#334)
Make nescapture better with proper queue family checks, FPS limiting, semaphore usage and other.. also updated deps like pollster and pixelforge. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=64083904"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=1"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=1"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=1" align="right"></picture></a>Confidence Score: 5/5</h2> The final review contains no accepted findings, so the PR appears safe to merge. <h3>Summary</h3> - This PR reworks `nescapture` frame capture around a four-slot DMA-BUF ring, tracks presentation queue families, adds semaphore-based capture/present ordering, introduces capture frame-rate pacing, carries presentation timestamps through encoding, and updates Vulkan-related dependencies. <sub>Reviews (1) · Last reviewed commit: ["feat: Update deps and remove deprecated ..."](https://github.com/nestrilabs/nestri/commit/79e21f4aac6f5d15679072bf576ed8cb182805c3)</sub> <!-- /greptile_comment --> --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
DatCaptainHorse
Claude Opus 5
parent
8246aa5538
commit
15ad60bf49
@@ -38,14 +38,28 @@ pub unsafe extern "system" fn vkCreateSwapchainKHR(
|
||||
|
||||
let result = unsafe { create_fn(device, &modified_ci, p_allocator, p_swapchain) };
|
||||
// If the driver rejects TRANSFER_SRC (e.g. composited window), try without.
|
||||
let result = if result != vk::Result::SUCCESS {
|
||||
unsafe { create_fn(device, ci, p_allocator, p_swapchain) }
|
||||
} else {
|
||||
let transfer_src = result == vk::Result::SUCCESS;
|
||||
let result = if transfer_src {
|
||||
result
|
||||
} else {
|
||||
unsafe { create_fn(device, ci, p_allocator, p_swapchain) }
|
||||
};
|
||||
if result != vk::Result::SUCCESS {
|
||||
return result;
|
||||
}
|
||||
if !transfer_src {
|
||||
log::warn!(
|
||||
"swapchain refused TRANSFER_SRC — capture disabled for this swapchain. \
|
||||
Blitting from images the driver did not grant transfer usage is undefined."
|
||||
);
|
||||
}
|
||||
ds.swapchain_transfer_src
|
||||
.store(transfer_src, Ordering::Relaxed);
|
||||
|
||||
// A fresh swapchain means fresh images behind the same indices. The
|
||||
// per-image capture semaphores may still be pending on presents from the
|
||||
// outgoing swapchain, so they are set aside rather than reused.
|
||||
crate::capture::retire_all_present_semaphores(&ds);
|
||||
|
||||
*ds.swapchain.lock().unwrap() = Some(unsafe { *p_swapchain });
|
||||
*ds.swapchain_format.lock().unwrap() = ci.image_format;
|
||||
|
||||
Reference in New Issue
Block a user