Skip to content

feat(d3d11): upload software-decoded NV12/P010 frames as CPU textures - #133

Closed
1824239290 wants to merge 1 commit into
AimesSoft:mainfrom
1824239290:split/d3d11-software-upload
Closed

1824239290 wants to merge 1 commit into
AimesSoft:mainfrom
1824239290:split/d3d11-software-upload

Conversation

@1824239290

Copy link
Copy Markdown
Contributor

概要

D3D11 后端增加软件解码帧的 CPU 上传路径:NV12/P010 平面数据作为 shader 资源上传,替代原先的直接报错拒绝。

背景

此前 D3D11 渲染后端对非 D3D11VA 帧(upload_player_frame 的软件分支)一律返回 "d3d11: software frames require WgpuFallback or a CPU upload path",宿主只能依赖 wgpu 回退链路。软解输出的 NV12/P010(包括 Dolby Vision Profile 5 按后端能力回退软解的场景)在 Windows 上需要这条路径可用。

改动

  • upload_player_frame 软件分支:校验平面尺寸后,将 luma/chroma 平面通过 create_overlay_texture 上传为 Nv12/P010 shader 资源。
  • ImportedVideoFrame 增加 _chroma_texture: Option<ID3D11Texture2D>,保持色度平面纹理存活(硬件路径置 None)。
  • 新帧进入前经过 retire_current_video() 的 GPU 等待屏障,与 修复 Windows 扫描线视频 DWM 崩溃、铺满尺寸及 D3D11VA 帧复用 #129 引入的硬件路径语义一致。
  • 接通 RendererRuntimeStats.software_video_frames(该字段此前恒为 0)。

验证

The D3D11 backend rejected every software-decoded video frame with
'd3d11: software frames require WgpuFallback or a CPU upload path',
forcing hosts through the wgpu fallback for CPU decode output. Upload
the planar luma/chroma planes as Nv12/P010 shader resources instead:
validate plane sizes against the format geometry, keep both plane
textures alive on ImportedVideoFrame via _chroma_texture, retire the
previous frame through the AimesSoft#129 GPU-wait barrier, and count the frames
in the software_video_frames runtime stat that previously sat at zero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant