- Render preview directly from the FP16 conversion target into the selected 8-bit or 10-bit swapchain, removing the full-frame scene copy and the intermediate BGRA8 preview pass without capture-frame decimation. - Simplify neutral YUY2/Y210 shaders to one packed texture load per pixel; preserve BT.709 conversion, 10-bit unpacking and odd-width chroma handling. - Cache shader resource views per upload slot and update constant-buffer contents only when source dimensions change. - Allocate only preview resources and skip export-only shader compilation for preview; retain the full BGRA8/RGB10A2/NV12 buffer conversion path. - Unbind render targets before swapchain resize/release and serialize preview configuration and resource changes with GPU rendering. - Bound startup Present retries and retry presentation without redrawing; retain actual skipped-frame counts when presentation remains busy. - Add preview delivery counters for presented, replaced, busy, failed, cancelled and pending frames, including busy source and affected frame ID. - Fix an uncounted pending-frame replacement and drain pending preview work at Stop and before a new run to keep per-run accounting separate. - Track application audio delivery, dropped duration, read/write stalls and frame-ID anomalies while retaining the original 10-block audio queue. - Stop the channel on audio write failure or two seconds of zero-write progress; distinguish cancelled data from runtime drops. - Keep the existing compact UI; aggregate delivery issue logs at most once per five seconds and emit a stop summary with accounting errors only. - Document diagnostic interpretation, GPU changes and validation boundaries. Validation: - User testing reported approximately 15% lower GPU utilization after the optimization. Baseline/final readings and relative versus percentage-point interpretation were not supplied; no independent benchmark was performed. - Static source checks and git diff --check passed. No application or shader build was performed by the agent; 10-bit startup resolution and long-run zero-loss behavior have not been confirmed. - Rebuild the preview DLL with its matching APP; the SDK GPU buffer converter also shares the modified shader source. Capture APIs and driver are unchanged.
27 lines
3.0 KiB
Markdown
27 lines
3.0 KiB
Markdown
# Preview GPU path
|
|
|
|
The preview worker now runs:
|
|
|
|
1. Execute the upload slot's command list (the SDK frame was already released by the caller).
|
|
2. Convert packed YUY2/Y210 into a full-resolution FP16 target.
|
|
3. Sample that FP16 target directly into the 8-bit or 10-bit swapchain, preserving aspect ratio.
|
|
4. Present. Startup retries repeat only Present, not the draw.
|
|
|
|
Compared with the previous preview, this removes one full-frame FP16 CopyResource per image. The 8-bit path also removes an intermediate BGRA8 draw and quantizes only at the swapchain. FP16 precision and the requested swapchain bit depth remain; no capture-frame decimation was added. Scaled 8-bit output may differ slightly because rounding now occurs after scaling instead of before it.
|
|
|
|
Each of the three upload slots owns its SRV; the worker no longer creates an SRV for every preview frame. YUY2/Y210 shaders use one packed texture load per output pixel. The old ProcAmp settings were fixed at neutral, so unused neighbor sharpness reads and neutral color adjustments were removed; BT.709 coefficients, packing, Y210 word shifts and odd-tail chroma behavior remain. Constant-buffer data updates only when source dimensions change, but its binding is restored each draw.
|
|
|
|
Preview-only resource initialization allocates only the FP16 conversion target, omitting scene, BGRA8 export, RGB10 export and NV12 planes. Export conversion still uses the default full resource path; no public capture or buffer API signature changed. Export shaders are not compiled for preview-only initialization.
|
|
|
|
Swapchain resize/release unbinds the render target before releasing local references. Preview configuration/resource changes and drawing share the D3D mutex. No GPU mutex is held while subsequently acquiring the renderer mutex in the worker completion path.
|
|
|
|
## Validation boundary
|
|
|
|
Source checks only in this change: no application/shader build, GPU timing or hardware playback test. These changes remove identifiable work but do not establish a GPU utilization reduction or identify the reported 10-bit startup failure.
|
|
|
|
User validation reported after the source change: GPU utilization decreased by approximately 15%. This is a user-reported observation, not an agent-run benchmark; baseline/final readings and whether the difference is relative or in percentage points were not specified. Resolution of the 10-bit startup failure was not reported.
|
|
|
|
Build the preview DLL with the changed shared pipeline source. If distributing the SDK GPU buffer converter, rebuild that DLL too because it shares the shader source. Keep the APP and preview DLL from the same delivery-statistics API revision.
|
|
|
|
On the target Ryzen 7 7700 system, compare identical resolution/FPS/window size and input formats before/after. Check 8-bit and 10-bit colors (including gradients), resize/fullscreen, repeated Start/Stop, Present skip counts and GPU engine utilization. Also verify public BGRA8/RGB10A2/NV12 buffer conversion if shipping its rebuilt DLL. Capture HRESULT details if 10-bit still fails; do not infer insufficient GPU capacity solely from utilization.
|