mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 07:09:59 +00:00
fix: align local WebGPU capture behavior (#2907)
* fix: align local WebGPU capture behavior * fix: address WebGPU capture review feedback * fix: retain overlapping GPU seek work * fix: satisfy runtime seek completion types * fix: drain concurrent GPU seek work * fix: prevent WebGPU capture barrier starvation * fix: keep WebGPU presentation active during render seeks
This commit is contained in:
@@ -2366,6 +2366,15 @@ async function captureFrameErrorDiagnostics(
|
||||
* Shared by captureFrame (disk) and captureFrameToBuffer (buffer).
|
||||
* Returns timing breakdown for perf tracking.
|
||||
*/
|
||||
export async function waitForPendingSeekCompletion(page: Pick<Page, "evaluate">): Promise<void> {
|
||||
await page.evaluate(async () => {
|
||||
const waitForCompletion = (
|
||||
window as Window & { __hfWaitForSeekCompletion?: () => Promise<void> }
|
||||
).__hfWaitForSeekCompletion;
|
||||
await waitForCompletion?.();
|
||||
});
|
||||
}
|
||||
|
||||
async function prepareFrameForCapture(
|
||||
session: CaptureSession,
|
||||
frameIndex: number,
|
||||
@@ -2406,6 +2415,7 @@ async function prepareFrameForCapture(
|
||||
if (session.onBeforeCapture) {
|
||||
await session.onBeforeCapture(page, quantizedTime);
|
||||
}
|
||||
await waitForPendingSeekCompletion(page);
|
||||
await page.evaluate(async () => {
|
||||
const runtime = (
|
||||
window as Window & {
|
||||
|
||||
Reference in New Issue
Block a user