Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
fix(capture): N2 fence slot indexing and CLI flag plumbing (direct ingress still opt-in)
Veyra Goal Agent14c965e42602
diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cppindex 8632fddb..da4a0c90 100644--- a/apps/veyra/ui/AppShell.cpp+++ b/apps/veyra/ui/AppShell.cpp@@ -269,7 +269,7 @@ LRESULT CALLBACK interaction(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR id,DWORD_Pif(id==VideoSurface&&m==WM_LBUTTONUP&&GetCapture()==h){ReleaseCapture();return 0;}return DefSubclassProc(h,m,w,l);}-veyra::engine::PlayerOptions options(){return veyra::engine::PlayerOptions::from(engine.snapshot().desired);}+veyra::engine::PlayerOptions options(){auto o=veyra::engine::PlayerOptions::from(engine.snapshot().desired);o.captureCpuUnpack=initialOptions.captureCpuUnpack;o.captureDirectIngress=initialOptions.captureDirectIngress;return o;}// Win32 dispatch reenters during move/resize and modal dialogs. Large path// buffers must be per-operation heap storage, never part of every WndProc frame.diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex f385053b..493c2640 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -8,6 +8,8 @@**处置**:`PlayerOptions::captureDirectIngress` 默认 **false**,保留 `--capture-direct-ingress` 供继续排查;信箱路径与所有既有行为不变。**未完成(如实)**:N2 未达标,需定位直接写入路径导致引擎每帧 reset/10fps 的根因(怀疑方向:Drop 标志自激、图 parity 与源槽位错位、upload fence 覆盖范围过大),修复并重新真机验证前不得计入收益。压缩解码链路仍未开工。+**同日后续(根因修复 + 新的阻塞点)**:定位到最可能的根因——**上传 fence 索引错位**:图按自己的 parity 记录提交 fence,但直接模式下缓冲槽位由源决定,丢帧后两者错位,源会在 GPU 仍在读取该缓冲时覆盖它(表现为 GPU-ready 84ms、每帧 reset、10fps 自激)。已修:直接帧的提交 fence 同时记录到其缓冲槽位(`uploadFences_[slot]`),并加了回调侧直接提交/回退计数(每 120 帧一条日志)。重跑时又发现 **`--capture-direct-ingress` 没有真正触发 attach**(日志无 `[capture-direct]`):根因是 `options()` 从引擎快照重建 `PlayerOptions` 时丢弃了 CLI-only 字段;已修(`options()` 现在携带 `captureCpuUnpack`/`captureDirectIngress`)。截至本轮结束,**带 attach 的直接路径尚未完成真机复测**:默认(信箱)路径健康、门禁 PASS(`logs/delivery/5b494cdb690d4254a670d1d14ccfe54e/result.json`),直接路径继续默认关闭。下一步:用 `--capture-direct-ingress` 复测确认 attach→直接提交计数→4K18 A/B,再决定是否转默认。+## 2026-09-16 采集链路 N1:逐像素转换从 CPU 挪到 GPU- 采集侧:`captureMediaLayout` 对 UYVY/YVYU/BGR24/RGB555/RGB565 保留驱动真实 packing(UYVY422/YVYU422/BGR24/RGB555LE/RGB565LE);`copyCaptureSample` 改为按行原样拷贝(保留 DIB 方向契约、手动翻转与 YUV 色度行跟随);新增 `captureLegacyCpuLayout` + `--capture-cpu-unpack` 诊断开关,旧 BGR0/YUY2 逐像素转换仍可回退。diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex c2ac791d..fe534f06 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -1577,6 +1577,14 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, FramefailedBackend_=engine::FailedBackend::None;if(runFg)fgHistorySkipped_=false;uploadFences_[parity]=ring_.lastSignaledValue();+ // N2 direct ingress: the producer wrote straight into one of the mapped+ // buffers, so record this submission's fence under that buffer's own slot+ // too; the source waits it before overwriting the buffer (its slot and the+ // graph parity can drift apart once a frame is dropped).+ if(frame&&frame->data[0]){+ if(frame->data[0]==mappedRgb_[0])uploadFences_[0]=ring_.lastSignaledValue();+ else if(frame->data[0]==mappedRgb_[1])uploadFences_[1]=ring_.lastSignaledValue();+ }prevPtsMs_ = ptsMs;prevValid_ = true;diff --git a/src/source/CaptureCardSource.cpp b/src/source/CaptureCardSource.cppindex c1b51cec..dd8a5a7f 100644--- a/src/source/CaptureCardSource.cpp+++ b/src/source/CaptureCardSource.cpp@@ -160,6 +160,7 @@ struct CaptureCardSource::Impl:ISampleGrabberCB {double directTime=0;Clock::time_point directArrival{};pipeline::Rational directDuration;bool directPending=false;int directSlot=-1; // consumer slot handed out by read()uint64_t directDrops=0;+ uint64_t directCommits=0,directFallbacks=0;// Manual capture flip; read by the DirectShow callback thread.std::atomic<bool> verticalFlip{false};std::unique_ptr<WasapiAudioInput> wasapi;@@ -198,6 +199,7 @@ struct CaptureCardSource::Impl:ISampleGrabberCB {directCommitted[directSlot]=buffer;}}+ if(useDirect)++directCommits;else if(directActive.load())++directFallbacks;// Copy directly into the destination; read() hands the buffer// out under this lock, so the frame consumed by the GPU is not// overwritten while it is in use.@@ -219,6 +221,7 @@ struct CaptureCardSource::Impl:ISampleGrabberCB {if(useDirect)directDuration=pendingDuration;if(!received)firstArrival=arrival;++received;latestArrival=arrival;+ if(directActive.load()&&(received%120)==0)log::info("capture-direct",std::format("commits={} fallbacks={} drops={} (direct ingress counters)",directCommits,directFallbacks,directDrops));}}wake.notify_one();return S_OK;