feat(video): add experimental D3D12 HDR analysis pipeline - #872
Draft
qiin2333 wants to merge 3 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Conflicts resolved in display.h and display_vram.cpp, plus the semantic fallout master introduced after this branch forked: - master added `float maxAnalysisNits` to the AnalysisParams / snapshot cbuffers, replacing one pad word. Thread `max_analysis_nits` through d3d12::hdr_analysis_t::initialize() and display_vram_t::make_d3d12_hdr_analysis() so the D3D12 constant buffer matches the shader layout; otherwise the D3D12 analysis path would upload 0 and clamp every luminance to 0. - master's readback now publishes analysis_max_nits and sample_sequence. read_d3d12_hdr_analysis_results() sets both so downstream HDR metadata treats D3D12 samples the same as D3D11 samples. - master's scene_metadata_active runtime-status transition now fires for both the D3D11 and D3D12 readback paths. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The hybrid D3D12 analysis path previously copied the snapshot texture into the shared resource every analysed frame, so it could only ever be slower than plain D3D11. The P010 converter now writes its cell statistics straight into a D3D11 UAV over the shared D3D12 texture, leaving the fence signal as the only extra work. Also stop the feature from taking anything else down with it: - A build without DXC emits zero-sized DXIL blobs instead of failing, and the analysis backend reports `hdr_shader_unavailable` at pipeline creation. FXC is now a cross-validation guard rail, not a requirement. - SUNSHINE_WINDOWS_VIDEO_BACKEND_STRICT=1 no longer bricks every encoder on a build where the D3D12 stage is not wired up. Only a real, failed initialization can mark the selection unavailable, which is what the design doc already described. - A successful D3D12 base initialization clears the build_stage_unavailable fallback, so the warning-level fallback log means an actual failure. - The full-resolution analysis fallback no longer dispatches while a D3D11 readback is still outstanding, and both readbacks are now drained every frame so an unread staging buffer cannot stay pending forever. - windows_video_backend is exposed in the Web UI (Advanced -> experimental features) with en/zh strings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了啥呀
windows_video_backend的auto/d3d11/d3d12选择、结构化诊断及严格模式。为啥要改
当前 Windows 捕获和编码交接仍以 D3D11 为主,HDR 分析又很容易掉进同步等待和重复复制这两个小杂鱼坑里。这次先把测量、资源所有权、显式同步和统计等价性打牢,为后续 fused conversion 与原生 D3D12 encoder surface 提供可验证的基础。
auto目前仍选择 D3D11;只有显式请求d3d12且 compute snapshot 可用时才启用 hybrid HDR analysis。初始化、提交或设备状态异常都会回退 D3D11,不扩大默认用户风险。验证
display_vram.cpp和video.cpp翻译单元使用 GCC 15.2、-Wall -Werror定向编译通过。cs_6_0analysis/reduce 编译通过;FXCcs_5_0analysis/reduce 校验通过。windows_video_pipeline_unit_tests.verify.exe:20/20 通过。pixels=4096min=100max=400sum=819200git diff --check通过。还需要关注