Skip to content

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++

release: publish 0.0.3 with selectable NR runtimes and capture guidance

Veyra Goal Agent83f635380386
diff --git a/AGENTS.md b/AGENTS.md
index 5326b9e7..e0fdb671 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,9 @@
# Veyra 项目 Agent 执行规则
+> 2026-09-11 用户授权发布当前0.0.3:源码推送到`Likely7/Veyra-NRVideo`,完整便携Release包含当前双NR运行版本和直播实验选项。此前用户指定的RTX40/50社区DLL可原样进入本次Release的`runtime/experimental/nr-community/`,身份沿用下条SHA256、310.8.0.0、165840496字节、`HashMismatch`,必须逐文件列入manifest并明确社区修改版;这是本次发布范围的扩展,不允许自动加入其他版本或修改文件。源码Git仍绝不包含SDK/DLL/模型。软件不恢复运行时哈希锁。OBS捕获说明按用户要求仅补README,不继续改软件提示。
+
+> 2026-09-11 用户指定RTX40/50社区NR运行时接入:允许把用户明确提供的`E:/Ai/mg/DLSSNR-DLL-Options-310.8.0.0/Community-RTX40-RTX50/nvngx_dlssnr.dll`原样复制到忽略的`runtime_local/nvidia/nr-community/`进行本机切换测试。该文件SHA256为`984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014`,签名状态`HashMismatch`,必须标注社区修改/实验,不能称为有效NVIDIA签名原版。用户指定此文件取代旧“仅根目录原版可本机加载”的限制;不授予Agent修改/重签名文件的权限,不自动扩大Release默认白名单,不上传DLL到源码Git。
+
> 2026-09-11 用户发布与替换决定:0.0.2发布到`Likely7/Veyra-NRVideo`,源码与Release二进制继续分离。用户明确要求去掉运行时校验、允许自行替换DLL:不得用固定哈希、签名或manifest拒绝用户替换的运行时;保留绝对路径加载、API存在性及初始化结果检查,替换不保证ABI/硬件兼容。下文相冲突的启动校验/禁止用户替换要求被本条取代。发布者制作的默认Runtime Pack仍按固定来源、哈希、签名与许可证审计;组件清单供用户查看,不作为软件加载锁。禁止将SDK/运行时/模型提交源码Git的规则不变。
> 2026-09-10 用户废弃旧 Loop:`loop/`、`scripts/loop-gate.ps1`、`CONTROL_HASHES.json` 及早期 Phase 排队/控制哈希停工规则全部退出当前执行流程,仅保留作历史记录。不得因旧 Loop 状态、STOP、控制哈希或旧文档顺序阻塞用户明确要求的修复,也不得更新旧清单来制造通过。当前任务以最新用户指令、对应修复计划和 `docs/WORKLOG.md` 为准。构建、针对性回归及必要的 `scripts/gates/delivery.ps1` 直接执行;单次测试最多 300 秒,并非全部测试累计 300 秒。运行时身份、源码/二进制隔离、真实验证与发布授权规则继续生效。
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98b74705..19b24947 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,21 @@
cmake_minimum_required(VERSION 3.24)
-project(veyra VERSION 0.0.2 LANGUAGES CXX RC)
+project(veyra VERSION 0.0.3 LANGUAGES CXX RC)
+
+# Match the compiler's actual bytes, including on localized Windows installs.
+# CMake's cached, decoded prefix can leave Ninja with zero header dependencies.
+if(MSVC AND CMAKE_GENERATOR MATCHES "Ninja")
+ set(VEYRA_INCLUDE_PROBE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/veyra-include-probe")
+ file(WRITE "${VEYRA_INCLUDE_PROBE}.h" "// Dependency parser probe\n")
+ file(WRITE "${VEYRA_INCLUDE_PROBE}.cpp" "#include \"veyra-include-probe.h\"\n")
+ execute_process(COMMAND "${CMAKE_CXX_COMPILER}" /nologo /utf-8 /showIncludes /c /TP "${VEYRA_INCLUDE_PROBE}.cpp" "/Fo${VEYRA_INCLUDE_PROBE}.obj"
+ OUTPUT_VARIABLE VEYRA_INCLUDE_OUTPUT ERROR_VARIABLE VEYRA_INCLUDE_OUTPUT
+ RESULT_VARIABLE VEYRA_INCLUDE_RESULT ENCODING NONE)
+ if(NOT VEYRA_INCLUDE_RESULT EQUAL 0 OR NOT VEYRA_INCLUDE_OUTPUT MATCHES "(^|[\r\n])([^\r\n]*: )[ ]*[A-Za-z]:[^\r\n]*veyra-include-probe.h")
+ message(FATAL_ERROR "Unable to verify MSVC/Ninja header dependency prefix")
+ endif()
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}")
+endif()
# ---------------------------------------------------------------------------
# Veyra cache variables and feature switches (Playbook section 5.1).
diff --git a/README.md b/README.md
index ffee369a..ecd28acb 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
Windows 视频播放器与采集卡增强工具。支持视频、图片和采集卡实时预览,可组合使用超分辨率、NR 画面增强与补帧。
-[下载 0.0.2 免安装版](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.2) · [更新记录](docs/RELEASE_NOTES_0.0.2.md) · [反馈问题](https://github.com/Likely7/Veyra-NRVideo/issues)
+[下载 0.0.3 免安装版](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.3) · [更新记录](docs/RELEASE_NOTES_0.0.3.md) · [反馈问题](https://github.com/Likely7/Veyra-NRVideo/issues)
## 功能
@@ -20,9 +20,11 @@ Windows 视频播放器与采集卡增强工具。支持视频、图片和采集
日常模式以观看为主;专业模式展开增强参数、诊断和导出工具。切换模式不需要重新打开视频。
+0.0.3 新增 NR 运行版本切换:NVIDIA 原版默认启用,另附 RTX 40/50 社区兼容实验版。RTX 40 尚未完成实机验证;专业模式布局重排仍在规划中。
+
## 下载与运行
-1. 在 [Releases](https://github.com/Likely7/Veyra-NRVideo/releases) 下载 **Veyra-0.0.2-win64-portable.zip**,不要下载 Source code。
+1. 在 [Releases](https://github.com/Likely7/Veyra-NRVideo/releases) 下载 **Veyra-0.0.3-win64-portable.zip**,不要下载 Source code。
2. 完整解压到一个可写文件夹,双击 **Veyra.exe**。无需安装 SDK、Python 或开发工具。
3. 使用当前显卡驱动。要使用 NVIDIA NR、DLSS、RTX Video SR 和 NVENC,需兼容的 NVIDIA RTX 显卡;本版本主要在 RTX 5070 上验证。
@@ -55,6 +57,16 @@ Windows 视频播放器与采集卡增强工具。支持视频、图片和采集
允许自行替换 DLL:退出软件后,NVIDIA 文件放在 `runtime/experimental/`,XeSS / XeLL 放在 `runtime_local/intel/experimental/`,保留文件名。软件不锁定哈希或签名;清单仅记录发布包原件,替换版的接口与硬件兼容性不作保证。卸载整个软件只需退出后删除解压目录。
+### NR 运行版本
+
+专业模式 → 增强 → NR 运行版本,可选 NVIDIA 原版或 RTX 40/50 社区兼容版。切换会短暂停顿,失败恢复上一套设置。社区版已随包放在 `runtime/experimental/nr-community/`,无需手动覆盖原版。它是社区修改文件,签名状态为 `HashMismatch`,不是有效 NVIDIA 签名原件;两版目前均在 RTX 5070 验证。
+
+### OBS 直播与录制
+
+添加“窗口采集”,选择 Veyra,并将“捕获方式”手动设为 **Windows 10(1903及以上)**。不要依赖“自动”:它可能选中 BitBlt,导致只捕获 UI、视频区域没有画面。本机已通过切换到该 Windows 捕获方式恢复视频。
+
+软件里的“直播兼容 · 实验”只切换显示交换链,不能解决 BitBlt 捕获问题,默认关闭即可。其他录屏软件优先选 Windows Graphics Capture / WGC;未验证所有录屏软件及补帧输出的捕获节奏。
+
## 技术路线与边界
```text
@@ -67,6 +79,6 @@ NR 与 DLSS 帧生成属于 **community experimental / 社区实验集成**,
## 开发与许可
-[构建说明](docs/BUILD.md) · [组件清单](docs/RUNTIME_COMPONENTS_0.0.2.md) · [第三方许可](THIRD_PARTY_NOTICES.md)
+[构建说明](docs/BUILD.md) · [组件清单](docs/RUNTIME_COMPONENTS_0.0.3.md) · [第三方许可](THIRD_PARTY_NOTICES.md)
源码采用 [GPLv3](LICENSE)。SDK、模型和运行时不进入源码仓库;Release 组件按各自许可与实验发布范围单独提供。
diff --git a/README_EN.md b/README_EN.md
index 022a4bb8..cb28847a 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -4,7 +4,7 @@ English | [简体中文](README.md)
A Windows video player and capture-card enhancement tool. Play videos, process images, and preview capture devices with optional super resolution, NR enhancement, and frame generation.
-[Download 0.0.2 Portable](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.2) · [Release Notes](docs/RELEASE_NOTES_0.0.2.md) · [Report an Issue](https://github.com/Likely7/Veyra-NRVideo/issues)
+[Download 0.0.3 Portable](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.3) · [Release Notes](docs/RELEASE_NOTES_0.0.3.md) · [Report an Issue](https://github.com/Likely7/Veyra-NRVideo/issues)
## Features
@@ -20,9 +20,11 @@ A Windows video player and capture-card enhancement tool. Play videos, process i
Daily mode focuses on watching. Professional mode expands the controls, diagnostics, and export tools without reopening the video. The application currently uses a Chinese interface.
+Version 0.0.3 adds NR runtime selection: the NVIDIA original remains the default, with an optional community RTX 40/50 experimental variant included. RTX 40 hardware validation is pending. The proposed Professional-mode layout redesign is not implemented yet.
+
## Download and Run
-1. Download **Veyra-0.0.2-win64-portable.zip** from [Releases](https://github.com/Likely7/Veyra-NRVideo/releases). The Source code archives are for developers.
+1. Download **Veyra-0.0.3-win64-portable.zip** from [Releases](https://github.com/Likely7/Veyra-NRVideo/releases). The Source code archives are for developers.
2. Extract the entire archive into a writable directory and run **Veyra.exe**. No SDK, Python, or development tools are needed.
3. Use a current GPU driver. NVIDIA NR, DLSS, RTX Video SR, and NVENC require compatible NVIDIA RTX hardware; this version was primarily tested on an RTX 5070.
@@ -55,6 +57,16 @@ Use Professional mode to save an image or export a video, then choose the format
You may replace DLLs while Veyra is closed. NVIDIA components belong in `runtime/experimental/`; XeSS / XeLL belong in `runtime_local/intel/experimental/`. Keep the filenames. Veyra does not enforce hash or signature locks; manifests describe the shipped files only. Replacement versions may have incompatible APIs or hardware requirements. To uninstall, close Veyra and delete its extracted directory.
+### NR Runtime Selection
+
+In Professional mode, open Enhancement and select the NR runtime. Choose the NVIDIA original or the community RTX 40/50 experimental variant. Switching briefly interrupts playback; failed changes restore the previous configuration. The community DLL is included in `runtime/experimental/nr-community/`, separate from the original. It is a modified binary with Authenticode status `HashMismatch`, not a valid NVIDIA-signed original. Both variants have been tested on an RTX 5070; RTX 40 testing is pending.
+
+### OBS Streaming and Recording
+
+Add a **Window Capture** source, select Veyra, and explicitly set **Capture Method** to **Windows 10 (1903 and up)**. Automatic may choose BitBlt, capturing the controls but missing the GPU-rendered video. Switching to the Windows capture method restored video in the reported local test.
+
+Veyra's experimental broadcast compatibility switch only changes the presentation swapchain; it does not fix BitBlt capture. Leave it off unless testing a specific capture issue. In other recording applications, prefer Windows Graphics Capture / WGC. Compatibility with every recorder and the capture cadence of generated frames have not been verified.
+
## Technical Approach and Limits
```text
@@ -67,6 +79,6 @@ NR and DLSS frame generation are **community-experimental integrations**, not NV
## Development and License
-[Build Instructions](docs/BUILD.md) · [Runtime Components](docs/RUNTIME_COMPONENTS_0.0.2.md) · [Third-Party Notices](THIRD_PARTY_NOTICES.md)
+[Build Instructions](docs/BUILD.md) · [Runtime Components](docs/RUNTIME_COMPONENTS_0.0.3.md) · [Third-Party Notices](THIRD_PARTY_NOTICES.md)
Source code is licensed under [GPLv3](LICENSE). SDKs, models, and runtimes are excluded from this source repository. Release components retain their separate licenses and experimental distribution boundaries.
diff --git a/apps/veyra/SettingsWindow.cpp b/apps/veyra/SettingsWindow.cpp
index fe51d69c..2f7fa7c9 100644
--- a/apps/veyra/SettingsWindow.cpp
+++ b/apps/veyra/SettingsWindow.cpp
@@ -53,6 +53,8 @@ void populate(engine::EnhancementSettings s){
if(send(202,CB_GETCOUNT)!=multiplierCount){send(202,CB_RESETCONTENT);const wchar_t* choices[]={L"关闭补帧",L"2X · 一张中间帧",L"3X · 两张中间帧",L"4X · 三张中间帧"};for(int i=0;i<multiplierCount;++i)send(202,CB_ADDSTRING,0,LPARAM(choices[i]));}
send(207,CB_SETCURSEL,s.videoSrQuality,0);send(202,CB_SETCURSEL,s.multiplier-1,0);
send(208,CB_SETCURSEL,int(s.frameGenerationBackend),0);send(203,CB_SETCURSEL,int(s.nrPolicy),0);
+ send(218,CB_SETCURSEL,int(s.nrRuntime));
+ check(219,s.captureCompatible?BST_CHECKED:BST_UNCHECKED);
send(204,CB_SETCURSEL,int(s.flow),0);send(205,CB_SETCURSEL,int(s.content),0);
send(209,CB_SETCURSEL,int(s.opticalFlowBackend),0);
check(215,s.amdFlowHalfResolution?BST_CHECKED:BST_UNCHECKED);
@@ -70,6 +72,8 @@ bool read(engine::EnhancementSettings& s,bool allPages=false){s=enhancementEnabl
if(multiplier==CB_ERR||generation==CB_ERR||flowBackend==CB_ERR||flowQuality==CB_ERR||content==CB_ERR){message(L"设置控件未完成初始化;未保存预设");return false;}
s.multiplier=uint32_t(multiplier+1);s.frameGenerationBackend=static_cast<engine::FrameGenerationBackend>(generation);s.opticalFlowBackend=static_cast<engine::OpticalFlowBackend>(flowBackend);s.amdFlowHalfResolution=checked(215)==BST_CHECKED;s.flow=static_cast<engine::FlowQuality>(flowQuality);s.content=static_cast<engine::ContentRate>(content);
s.audioSync=static_cast<engine::AudioSyncMode>(send(216,CB_GETCURSEL));
+ s.nrRuntime=static_cast<engine::NrRuntime>(send(218,CB_GETCURSEL));
+ s.captureCompatible=checked(219)==BST_CHECKED;
wchar_t offset[32]{};GetWindowTextW(item(217),offset,32);wchar_t* offsetEnd=nullptr;const auto parsed=wcstol(offset,&offsetEnd,10);
if(offsetEnd==offset||*offsetEnd||parsed<-250||parsed>250){message(L"声音偏移须为 -250 至 250 ms");return false;}s.audioOffsetMs=int(parsed);
for(int j=0;j<3;++j)if(GetPropW(item(730+j),L"veyra.selected")){s.srTarget=static_cast<pipeline::SrTarget>(j);break;}
@@ -86,6 +90,8 @@ bool liveField(int id){
switch(id){case 100:s.model.intensity=v;break;case 101:s.model.tone=v;break;case 102:s.model.structure=v;break;case 103:s.model.skin=v;break;
case 107:s.residual.total=v;break;case 108:s.residual.darken=v;break;case 109:s.residual.brighten=v;break;case 110:s.residual.color=v;break;case 111:s.residual.luminance=v;break;default:return false;}
}else switch(id){
+ case 219:s.captureCompatible=checked(id)==BST_CHECKED;break;
+ case 218:s.nrRuntime=static_cast<engine::NrRuntime>(send(id,CB_GETCURSEL));break;
case 202:s.multiplier=uint32_t(send(id,CB_GETCURSEL)+1);break;
case 203:s.nrPolicy=static_cast<pipeline::NrSizePolicy>(send(id,CB_GETCURSEL));break;
case 204:s.flow=static_cast<engine::FlowQuality>(send(id,CB_GETCURSEL));break;
@@ -121,7 +127,7 @@ void arrange(){
scroll=std::clamp(scroll,0,std::max(0,contentHeight-viewport));
SetWindowPos(body,nullptr,0,dip(window,sticky),r.right,dip(window,viewport),SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
auto batch=BeginDeferWindowPos(int(items.size()));
- for(auto& entry:items){bool fixed=entry.page==-1,visible=entry.page==page||fixed;int w=entry.w<0?width-entry.x-12:entry.w;int y=fixed?(GetDlgCtrlID(entry.h)==400?0:GetDlgCtrlID(entry.h)==211?86:42):entry.y-scroll;
+ for(auto& entry:items){bool fixed=entry.page==-1,visible=entry.page==page||fixed;int w=entry.w<0?width-entry.x-12:entry.w;int y=fixed?(GetDlgCtrlID(entry.h)==400?0:(GetDlgCtrlID(entry.h)==211||GetDlgCtrlID(entry.h)==219)?86:42):entry.y-scroll;
if(fixed){SetWindowPos(entry.h,nullptr,dip(window,entry.x),dip(window,y),dip(window,std::max(1,w)),dip(window,42),SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOREDRAW);continue;}batch=DeferWindowPos(batch,entry.h,nullptr,dip(window,entry.x),dip(window,y),dip(window,std::max(1,w)),dip(window,entry.height),SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCOPYBITS|(visible?SWP_SHOWWINDOW:SWP_HIDEWINDOW));}
EndDeferWindowPos(batch);RedrawWindow(body,nullptr,nullptr,RDW_INVALIDATE|RDW_ALLCHILDREN);InvalidateRect(window,nullptr,FALSE);
}
@@ -130,6 +136,8 @@ HWND add(const wchar_t* cls,const wchar_t* text,int id,DWORD style,int group,int
void button(const wchar_t* title,int id,int group,int x,int y,int width=-1){add(L"BUTTON",title,id,BS_PUSHBUTTON|WS_TABSTOP,group,x,y,width,36);}
void combo(int id,int group,int y,std::initializer_list<const wchar_t*> names){auto h=add(L"COMBOBOX",L"",id,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP,group,12,y,-1,200);for(auto name:names)SendMessageW(h,CB_ADDSTRING,0,LPARAM(name));}
LRESULT CALLBACK proc(HWND h,UINT msg,WPARAM wp,LPARAM lp){
+ if(msg==WM_COMMAND&&!populating&&LOWORD(wp)==219&&HIWORD(wp)==BN_CLICKED){liveField(219);return 0;}
+ if(msg==WM_COMMAND&&!populating&&LOWORD(wp)==218&&HIWORD(wp)==CBN_SELCHANGE){liveField(218);return 0;}
if(msg==WM_COMMAND&&!populating&&((LOWORD(wp)==216&&HIWORD(wp)==CBN_SELCHANGE)||(LOWORD(wp)==217&&HIWORD(wp)==EN_CHANGE))){liveField(LOWORD(wp));return 0;}
if(msg==WM_COMMAND&&!populating&&((LOWORD(wp)==209&&HIWORD(wp)==CBN_SELCHANGE)||(LOWORD(wp)==215&&HIWORD(wp)==BN_CLICKED))){liveField(LOWORD(wp));return 0;}
switch(msg){
@@ -147,7 +155,9 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();displayedBackendWarning.
auto slider=add(TRACKBAR_CLASSW,L"",600+i,TBS_HORZ|TBS_NOTICKS|WS_TABSTOP,0,12,y+32,-1,16);SendMessageW(slider,TBM_SETRANGE,TRUE,MAKELPARAM(i==3?-100:0,i<3?100:200));}
add(L"STATIC",L"增强变化量",1101,0,0,12,606,-1,24);
add(L"STATIC",L"肤质 / 风格 / 遮罩 / UI键为本地实验参数。未验证的效果不会标成可用能力。",1102,0,0,12,956,-1,70);
- button(L"还原默认",211,-1,12,86);
+ button(L"还原默认",211,-1,12,86,88);
+ add(L"BUTTON",L"直播兼容 · 实验",219,BS_AUTOCHECKBOX|WS_TABSTOP,-1,108,86,-1,36);
+ SetPropW(item(219),L"veyra.tip",HANDLE(L"直播兼容模式:切换显示交换链,会短暂停顿;不改变增强算法或导出。不保证所有捕获方式有效。"));
add(L"STATIC",L"补帧与运动估算",1103,0,1,12,12,-1,30);
add(L"STATIC",L"补帧方式",1111,0,1,12,50,-1,24);
combo(208,1,78,{L"DLSS 帧生成",L"Intel XeSS · 实验显示补帧 2X"});
@@ -184,6 +194,10 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();displayedBackendWarning.
combo(207,0,100,{L"DLSS SR",L"RTX 视频超分 · 低",L"RTX 视频超分 · 中",L"RTX 视频超分 · 高",L"RTX 视频超分 · 最高"});
for(auto& entry:items)if(entry.page==0&&entry.y>=100)entry.y+=44;
button(L"2K",730,0,12,100,80);button(L"4K",731,0,100,100,80);button(L"8K",732,0,188,100,80);
+ for(auto& entry:items)if(entry.page==0&&entry.y>=56)entry.y+=80;
+ add(L"STATIC",L"NR 运行版本",1117,0,0,12,56,-1,24);
+ combo(218,0,84,{L"NVIDIA 原版 · RTX 50",L"社区兼容 · RTX 40/50 实验"});
+ SetPropW(item(218),L"veyra.tip",HANDLE(L"社区版为用户提供的修改版;RTX 40 兼容性需实机验证。切换会重建增强管线。"));
loadStore();refreshPresets();populate(controller->snapshot().desired);message(store.error());SetTimer(h,1,250,nullptr);arrange();return 0;}
case WM_SIZE:arrange();return 0;
case WM_ERASEBKGND:return 1;
diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cpp
index ed26abbf..c02c8515 100644
--- a/apps/veyra/ui/AppShell.cpp
+++ b/apps/veyra/ui/AppShell.cpp
@@ -42,7 +42,7 @@ std::wstring smokeView;bool smokeViewApplied=false;
std::wstring smokeDualOutput;bool smokeEmpty=false;DWORD modeGdiStart=0,modeHandlesStart=0;SIZE_T modePrivateStart=0;
bool smokeDual=false,smokeDualPause=false,smokeMaster=false,smokeMasterReject=false,smokeAudio=false,smokeJob=false,smokeJobCancel=false,smokeJobExit=false;int dualStep=0,masterStep=0,audioStep=0,jobStep=0;double pausedPosition=-1,jobPosition=0;uint64_t pausedFrames=0;ULONGLONG jobPauseTick=0;HANDLE workerMapping=nullptr;
void switchMode();void selectInspector(int);void refreshDailyPresets();
-bool applySettings(veyra::engine::EnhancementSettings s){if(masterPendingRevision)return false;uiState.configured=s;if(uiState.enhanced)engine.requestSettings(s);else veyra::log::info("ui-settings","enhancement off: draft saved for explicit enable");veyra::ui::settingsEnabled(uiState.enhanced,uiState.configured);return true;}
+bool applySettings(veyra::engine::EnhancementSettings s){if(masterPendingRevision)return false;uiState.configured=s;if(uiState.enhanced)engine.requestSettings(s);else {auto effective=engine.snapshot().desired;if(effective.captureCompatible!=s.captureCompatible){effective.captureCompatible=s.captureCompatible;engine.requestSettings(effective);}veyra::log::info("ui-settings","enhancement off: draft saved; presentation setting applied independently");}veyra::ui::settingsEnabled(uiState.enhanced,uiState.configured);return true;}
struct ToolbarItem{HWND hwnd;int width;};std::vector<ToolbarItem> toolbar;
bool full=false,holdOriginal=false,referenceBase=false;int compareMode=0;float compareSplit=.5f;WINDOWPLACEMENT windowPlacement{sizeof(windowPlacement)};
@@ -425,7 +425,7 @@ CoInitializeEx(nullptr,COINIT_APARTMENTTHREADED);
std::filesystem::create_directories(veyra::runtime::logsDirectory());wchar_t logOverride[32768]{};GetEnvironmentVariableW(L"VEYRA_LOG_FILE",logOverride,32768);veyra::Logger::instance().openFile(logOverride[0]?std::wstring(logOverride):(veyra::runtime::logsDirectory()/"veyra-app.log").wstring());
initialOptions=veyra::engine::PlayerOptions::from(veyra::ui::defaultSettings());
-int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,4);initialOptions.fg=true;}else if(arg==L"--video-sr"&&i+1<argc){initialOptions.settings.videoSrQuality=std::clamp(_wtoi(argv[++i]),1,4);initialOptions.sr=true;}else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);
+int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,4);initialOptions.fg=true;}else if(arg==L"--video-sr"&&i+1<argc){initialOptions.settings.videoSrQuality=std::clamp(_wtoi(argv[++i]),1,4);initialOptions.sr=true;}else if(arg==L"--nr-community")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Community;else if(arg==L"--nr-original")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Original;else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);
if(workerMapping){const int code=veyra::engine::runExportWorker(workerMapping);CoUninitialize();return code;}
if(smokeSeconds<=0&&exportOutput.empty()){uiPreferences=preferences.load();initialOptions=veyra::engine::PlayerOptions::from(preferences.startup(initialOptions.snapshot()));engine.setVolume(uiPreferences.volume,uiPreferences.muted);uiState.subtitles=uiPreferences.subtitles;subtitlePixels=uiPreferences.subtitleSize;}
engine.requestSettings(initialOptions.snapshot());
diff --git a/apps/veyra/ui/LiveStatusPanel.h b/apps/veyra/ui/LiveStatusPanel.h
index 04e20e17..4bf91283 100644
--- a/apps/veyra/ui/LiveStatusPanel.h
+++ b/apps/veyra/ui/LiveStatusPanel.h
@@ -64,6 +64,8 @@ inline LRESULT CALLBACK proc(HWND h,UINT message,WPARAM wp,LPARAM lp){
}
rows.emplace_back(L"补帧方式",s.applied.multiplier<=1?L"关闭":std::format(L"{} {}X",xess?L"XeSS":L"DLSS",s.applied.multiplier));
rows.emplace_back(L"NR内部尺寸",s.applied.nr?std::format(L"{} x {}",s.metrics.resolution.nr.width,s.metrics.resolution.nr.height):L"关闭");
+ rows.emplace_back(L"NR运行版本",s.nrActive?(s.applied.nrRuntime==engine::NrRuntime::Community?L"社区兼容 · 实验":L"NVIDIA原版"):L"未运行");
+ rows.emplace_back(L"显示模式",s.running?(s.applied.captureCompatible?L"直播兼容 · 实验":L"标准显示"):L"未运行");
rows.emplace_back(L"音频同步",s.audioAvailable?(s.capture?(s.captureAudio.running?L"软件估算同步":L"等待视频锚点"):(s.audioEndpointRecovering?L"音频设备恢复中 · 时间线保持":s.audioRebuffering?L"视频过载 · 同步缓冲":L"音频主时钟")):L"无音频");
if(!s.capture&&s.audioAvailable){
rows.emplace_back(L"音频设备恢复次数",std::to_wstring(s.audioEndpointRecoveries));
diff --git a/docs/BROADCAST_COMPATIBILITY_PLAN_2026-09-11.md b/docs/BROADCAST_COMPATIBILITY_PLAN_2026-09-11.md
new file mode 100644
index 00000000..8df413ef
--- /dev/null
+++ b/docs/BROADCAST_COMPATIBILITY_PLAN_2026-09-11.md
@@ -0,0 +1,42 @@
+# 直播兼容实验模式
+
+## 范围
+
+用户要求提供可选开关进行捕获对照,并先提供专业模式UI调整方案。本次默认恢复FLIP_DISCARD,勾选“直播兼容 · 实验”使用FLIP_SEQUENTIAL。没有进程检测,不依赖OBS先后启动。该实验不是已经证明解决捕获问题的修复;前序对“子窗口FLIP_DISCARD就是根因”的定论缺乏实际捕获对照,撤回该定论。
+
+入口位于专业参数面板顶部、还原默认按钮右侧,四个页面均可见,不随参数滚动。生效模式在实时处理状态中显示。UI整体重排仅写方案,见 `PROFESSIONAL_UI_LAYOUT_PLAN_2026-09-11.md`。
+
+## 行为与边界
+
+- `EnhancementSettings.captureCompatible` 默认false;v10预设保存开关,旧v1-v9默认false。还原默认关闭直播兼容。
+- `PresentSink::Desc` 接收开关,以GetDesc1确认创建的交换链类型符合请求;失败返回错误,设置事务负责回退。保持RGBA8、三缓冲、原有vsync/tearing和GPU呈现路径,没有逐帧CPU像素回读。
+- `VideoPresenter`向呈现端传递设置,播放/采集/普通图片在原有事务边界排空、重建和回退,包含暂停预览与恢复路径。切换存在短暂停顿,目前沿用完整图重建,不能称为仅一行参数无成本切换。
+- 总增强关闭时,显示设置仍独立请求生效,不打开NR/SR/FG。大图单独重建预览呈现器,纯显示变化不重新处理全部NR分块。离线视频导出不使用该选项改变输出。
+- XeSS使用代理交换链;以实际GetDesc1为准,不兼容则通过既有错误/回退机制处理。本轮不承诺第三方捕获能获取所有XeSS生成帧。
+- 没有自动检测外部软件是否抓到画面,状态只表示交换链选项已应用。两种模式均不能保证传统BitBlt捕获GPU画面;后续对照应区分WGC窗口捕获、游戏捕获和显示器捕获。
+- 性能和画质变化尚无外部捕获对照证据。不能宣称固定增加一帧、必然黑屏或已经改善GPU占用。
+
+## 验证记录
+
+本轮开关与设置接入完成,标准入口 `Veyra.cmd` 对应 `out/build/x64-release/veyra.exe` 已更新。EXE SHA256 `041A14751E182936B21A8878AE7C3508C96EF9009FA9C1D05171121315A82F74`。
+
+实际执行:
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release
+out/build/x64-release/veyra_repair_preset_tests.exe logs/broadcast-preset-test.v1
+out/build/x64-release/veyra_repair_contract_tests.exe
+python scripts/acceptance/ui-broadcast-mode.py out/build/x64-release/veyra.exe
+python scripts/acceptance/ui-broadcast-mode.py out/build/x64-release/veyra.exe --xess
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root . -BuildDirectory out/build/x64-release
+```
+
+构建exit0,日志 `logs/broadcast-mode-build.log`;CPU合同81项、v4-v10预设42组迁移和完整设置往返通过,v1升级亦通过。真实RTX5070运行,NR及DLSSG Create `0x1` / SEH0。UI脚本以实际按钮触发标准→兼容→标准,再关闭总增强后往返;覆盖暂停、全屏进出、1280x900和1040x540固定位置及滚动不移动开关,截图非黑。DLSS结果 `logs/broadcast-mode/1789101764400727400/result.json`,XeSS结果 `logs/broadcast-mode/1789101876592375800/result.json` 均PASS,对应app.log记录请求和实际swapEffect及Applied revision。截图为软件桌面显示,未冒充外部窗口捕获。
+
+delivery23项PASS,42.881秒,`logs/delivery/e6eb77b2bcc5468781d458f7e5371e77/result.json`、`logs/broadcast-delivery.log`。本次没有执行实体采集卡、社区NR与兼容模式组合、超大图片切换专项、外部录制画质/性能对照或新的错误注入回退测试;回退接入既有事务。下一步唯一验收为用户在同一捕获源上切换开关对照,记录外部软件捕获方式。不要把测试通过解释为原捕获故障已解决。
+
+修改文件:设置结构和v10预设/单元测试;`PresentSink.h/.cpp`、`VideoPresenter.h/.cpp`、`EngineController.cpp`、`EngineControllerImage.cpp`;`SettingsWindow.cpp`、`AppShell.cpp`、`LiveStatusPanel.h`;新增UI回归脚本、本方案和专业布局方案、WORKLOG。没有引入逐帧进程枚举或额外颜色转换。
+
+首次UI脚本等候采集专用frame-rate日志,在文件回放中超时,程序实际播放正常;改为等候文件player-timing记录。第二次总增强关闭后立即点击触发已有的主开关事务互斥,脚本增加等待UI完成事务;不绕过产品互斥。
+
+本次未新增运行DLL、未推送或发布。原NR双运行时工作区修改继续保留。
diff --git a/docs/BUILD.md b/docs/BUILD.md
index f6084f9e..a362a0f4 100644
--- a/docs/BUILD.md
+++ b/docs/BUILD.md
@@ -5,7 +5,7 @@
## Requirements
- Windows 11 x64, Visual Studio 2022 C++ tools, Windows SDK, CMake 3.24+, Ninja.
-- Local FFmpeg development libraries matching avcodec63 / avformat63 / avutil61 / swresample7 / swscale10. Release 0.0.2 uses the vcpkg FFmpeg 9.0.1#1 build (LGPL configuration).
+- Local FFmpeg development libraries matching avcodec63 / avformat63 / avutil61 / swresample7 / swscale10. Release 0.0.3 uses the vcpkg FFmpeg 9.0.1#1 build (LGPL configuration).
- NVIDIA DLSS SDK 310.7.0, Optical Flow SDK 5.0.7, RTX Video SDK 1.1.0, and nv-codec-headers. Prepare these under their respective licenses in ignored local directories.
- Intel XeSS SDK 3.0.2 for the XeSS presenter; AMD FidelityFX SDK 1.1.4 optical-flow/backend static libraries for the AMD flow option.
- Local NR runtime and NGX project configuration for experimental NR. The source repository intentionally does not contain them.
@@ -35,7 +35,7 @@ The NGX configuration lives in `runtime_local/config/ngx-local.json` for develop
## Dependency Sources
-Release 0.0.2 includes `Veyra-0.0.2-FFmpeg-source.zip` separately: the patched FFmpeg source, SPDX-verified vcpkg port and patches, notices, and configuration queried from the shipped DLL. It is not needed to run Veyra.
+Release 0.0.3 includes `Veyra-0.0.3-FFmpeg-source.zip` separately: the patched FFmpeg source, SPDX-verified vcpkg port and patches, notices, and configuration queried from the shipped DLL. It is not needed to run Veyra.
- FFmpeg: https://github.com/FFmpeg/FFmpeg/tree/n9.0.1 ; vcpkg port source recorded in the distributed `licenses/FFMPEG-SPDX.json`.
- vcpkg FFmpeg port: https://github.com/microsoft/vcpkg/tree/55cd8b8a4f19d8e6ba2ad114c8acacc4af5915a0/ports/ffmpeg . Its patches and the LGPL notices are part of the corresponding-source material.
@@ -51,7 +51,7 @@ Veyra and FidelityFX code are compiled into the executable; FFmpeg is dynamicall
Run targeted tests and `scripts/gates/delivery.ps1`; each individual test must stay below300seconds. Physical capture and screen scanout require separate hardware verification. The legacy Loop gate is not part of the current process.
```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1 -Root . -Version 0.0.2 -OutputDirectory out/releases/0.0.2
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1 -Root . -Version 0.0.3 -OutputDirectory out/releases/0.0.3
```
The packager accepts `-BuildDirectory` for an isolated build, checks the publisher's fixed input files, copies an explicit payload, and emits a ZIP, checksums, and component manifests. It refuses to overwrite an existing candidate. This build-time audit does not restrict user DLL replacement. Do not upload SDK headers, samples, libraries, private media, logs, or development archives with the source.
diff --git a/docs/NR_RUNTIME_SWITCH_PLAN_2026-09-11.md b/docs/NR_RUNTIME_SWITCH_PLAN_2026-09-11.md
new file mode 100644
index 00000000..83528dd1
--- /dev/null
+++ b/docs/NR_RUNTIME_SWITCH_PLAN_2026-09-11.md
@@ -0,0 +1,65 @@
+# NR 双运行时切换
+
+用户提供 `E:/Ai/mg/DLSSNR-DLL-Options-310.8.0.0/Community-RTX40-RTX50/nvngx_dlssnr.dll`,要求在软件中选择RTX50原版或RTX40/50社区兼容版。原版保留默认,专业模式提供手动选择;不根据尚未实测的硬件声明自动切换或扩大兼容性承诺。
+
+## 输入与边界
+
+- 原版:310.8.0.0,165840496字节,SHA256 `E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E`,NVIDIA签名有效。
+- 用户指定社区版:同版本与大小,SHA256 `984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014`,Authenticode `HashMismatch`。这不是有效签名的NVIDIA原件;用户明确选用该文件进行本机接入,不修改或重签名它。
+- 本机RTX5070只验证两版加载、真实NR输出、切换和回退。RTX40实际效果/稳定性未由本机验证。暂不修改已发布0.0.2资产,不把社区DLL加入默认发布白名单或Git。
+
+## 实施
+
+1. 设置新增Original/Community运行时枚举,旧预设默认Original,新预设保存选择。三入口共用Graph,图片分块和导出同样携带该设置。
+2. 原版目录保持不变,社区版放在其`nr-community/`子目录,均保留文件名`nvngx_dlssnr.dll`。仅NR适配器切换绝对路径,SR/FG/VSR和NGX配置不迁移。
+3. 专业模式加入“NR运行版本”选择,沿用现有玻璃选择器和滚轮只滚页规则。运行中先排空GPU/呈现、释放旧Feature/DLL再重建;缺文件、缺API或初始化失败通过设置事务回退。
+4. 定向测试覆盖预设迁移、两版实际Create/Evaluate与非黑输出、往返切换、缺文件回退,以及社区版视频导出。单次测试上限300秒。执行必要delivery并更新WORKLOG。
+
+## 交付状态
+
+本机接入和针对性验证完成。专业模式的增强页新增“NR 运行版本”:默认“NVIDIA 原版 · RTX 50”,可选择“社区兼容 · RTX 40/50 实验”。实时状态显示实际生效的版本,关闭NR时显示未运行。选择保存到v9预设,旧v1-v8预设默认原版。切换需要重建管线,存在短暂停顿;初始化失败会回退,不能称为无停顿热切换。
+
+初次交付只更新了 `out/build/release-0.0.2-final/veyra.exe`,遗漏常用入口,用户截图确认打开的仍是旧程序。后续已在旧进程退出后清理标准构建目标并完整重建 `out/build/x64-release/veyra.exe`;现在根目录 `Veyra.cmd` 可直接打开含双运行时选择器的新版。本轮没有更新GitHub或0.0.2发布资产。
+
+入口补交付:`cmake --build out/build/x64-release --target clean`,随后 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release` 完整174目标exit0,日志 `logs/nr-runtime-default-entry-build.log`。标准入口EXE SHA256 `4AB989BC9223F8EE821CF449CE7A0F2DE14C49F7C3C08E1ECC4299DC411E88D4`。用该EXE再次运行 `python scripts/acceptance/ui-nr-runtime.py out/build/x64-release/veyra.exe runtime_local/nvidia/nr-community/nvngx_dlssnr.dll`,原版/社区往返、缺文件回退和两种窗口布局均PASS,结果 `logs/nr-runtime-switch/1789100030646506400/result.json`。下面隔离构建的完整GPU/导出证据保留,不将不同路径EXE哈希混为一谈。
+
+### 修改范围
+
+- `EnhancementSettings.h`、`EnhanceGraph.h/.cpp`、`DlssNrRuntimeAdapter.cpp`:枚举、独立目录、NR加载和设置合同。
+- `EngineController.cpp`、`EngineControllerImage.cpp`、`VideoExportJob.cpp`:播放/采集共享设置事务、分块图片、视频导出的运行版本传递与回退。
+- `PresetStore.cpp`、`RepairPresetTests.cpp`:v9持久化、旧版迁移、无效枚举拒绝。
+- `SettingsWindow.cpp`、`LiveStatusPanel.h`、`AppShell.cpp`:玻璃选择器、实际状态和 `--nr-community` / `--nr-original` 参数。
+- `CMakeLists.txt`:修复本机MSVC/Ninja头文件依赖识别;`scripts/acceptance/ui-nr-runtime.py`:实际控件切换与回退检查。
+- `AGENTS.md`、本方案和 `WORKLOG.md`:用户指定文件授权、身份与交付证据。
+
+### 构建与验证
+
+最终EXE SHA256:`6C3723B1E0F3E10BA456905E39F94824A7E650C5E10E28545201DFCE73A75976`。以下均在本机RTX5070完成,单次短测少于300秒。命令从项目根目录运行;`$exe` 表示上方新版EXE绝对路径,`$clip` 表示 `loop/local/fixed_clips/test_av_1080p.mp4` 的绝对路径,旧素材目录名不代表恢复Loop流程。
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release -BuildDirectory out/build/release-0.0.2-final
+out/build/release-0.0.2-final/veyra_repair_preset_tests.exe logs/nr-runtime-preset-test.v1
+out/build/release-0.0.2-final/veyra_repair_contract_tests.exe
+python scripts/acceptance/ui-nr-runtime.py out/build/release-0.0.2-final/veyra.exe runtime_local/nvidia/nr-community/nvngx_dlssnr.dll
+& $exe $clip --nr-community --nr --sr --fg --export-out logs/nr-community-export.mp4 --max-frames 12
+& $exe $clip --nr-community --nr --no-sr --no-fg --smoke-dual --smoke-job --smoke-dual-export logs/nr-community-worker-final.mp4 --smoke-seconds 22
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root . -BuildDirectory out/build/release-0.0.2-final
+```
+
+- 清理该隔离构建目录的目标后完整重建174个目标成功,日志 `logs/nr-runtime-clean-build.log`。原用户进程未终止。
+- CPU合同81项、预设36组迁移及当前字段往返通过;预设测试使用新临时文件,重跑须换未存在的路径。
+- 社区版播放:`logs/nr-community-second.stdout.log`,Init_Ext/CreateFeature18为 `0x1`、SEH0,239次NR、236次NVOF;保存1920x1080非黑JPEG。
+- UI:`logs/nr-runtime-switch/1789099278517146300/result.json` 为PASS。实际弹出选择器完成社区→原版→缺社区文件拒绝并恢复原版→社区→原版;源保持打开,各成功切换Create为 `0x1`。1280x900、1040x540均能滚动访问,滚轮不改选项,视频像素非黑。
+- 社区SR+NR+FG导出:`logs/nr-community-export.stdout.log` 和MP4。3840x2160、H264+AAC、120fps、24帧;12源帧、11生成帧、1显式CFR补齐帧,不能把补齐帧写成生成帧。
+- 独立导出进程:`logs/nr-community-worker-final.stdout.log`、`logs/export-worker-24872.log`。子进程明确加载社区目录,Init/Create `0x1`、SEH0,导出120源帧且前台继续播放,冻结参数不随前台修改改变,exit0。使用ffprobe检查输出视频与音轨。
+- 最终delivery23项全部通过,43.129秒;`logs/delivery/e39733bf752b414c9fbc06f4c08ef230/result.json`、`logs/nr-runtime-delivery.log`。此项包含原版基线,不替代社区版专项结果。
+
+### 失败与修正
+
+初次增量构建后的空窗口启动崩溃发生在加载NR之前。调试定位到 `exportJob.poll()` 的wstring析构访问冲突:本机CMake缓存的中文 `/showIncludes` 前缀乱码,Ninja记录头文件依赖为0,设置结构新增字段后 `ExportJobManager.cpp` 没有重编译,造成混合ABI。通过实际 `/c /utf-8 /showIncludes` 编译探针提取原始字节前缀,并完整重建解决;最终该目标记录13个依赖,包含 `EnhancementSettings.h`。调试证据 `logs/nr-ui-exception.log`。强设VSLANG因未安装英文编译资源无效,`/EP`探针和实际编译前缀不同,也未采用;失败日志保留在 `logs/nr-runtime-dependencies-build.log`、`logs/nr-runtime-prefix-build.log`。
+
+UI脚本两次早期失败分别是短窗未滚动到控件、日志缓冲尚未刷新,修正为滚动可达和等待真实Applied记录后通过。首次独立导出测试漏传 `--smoke-dual`,没有触发worker,exit1;补齐参数后上述最终测试通过。没有将这些失败解释为社区DLL不兼容。
+
+### 未验证与下一步
+
+RTX40硬件的Create/Evaluate、效果、性能和稳定性未执行;本次也未新增实体采集卡/长期测试。图片分块设置传递已接入但未做社区版超大图片专项。下一步唯一验收为RTX40用户使用新版并选择社区兼容运行版本进行实测,收集真实日志。本机通过不代表整个40系列兼容,也不代表社区文件具有有效NVIDIA签名。本次DLL仅留在gitignore本地目录,不提交、不自动发布。
diff --git a/docs/PROFESSIONAL_UI_LAYOUT_PLAN_2026-09-11.md b/docs/PROFESSIONAL_UI_LAYOUT_PLAN_2026-09-11.md
new file mode 100644
index 00000000..89c6433e
--- /dev/null
+++ b/docs/PROFESSIONAL_UI_LAYOUT_PLAN_2026-09-11.md
@@ -0,0 +1,101 @@
+# 专业模式文字与布局调整方案
+
+状态:待用户确认,尚未实施面板重排。本轮仅增加直播兼容实验开关。
+
+## 当前问题
+
+当前 `SettingsWindow.cpp` 的增强页混放NR总开关、运行版本、超分、NR尺寸策略、保护区域和12组模型/残差参数;音频藏在补帧页底部。大量通过逐次增加y偏移插入的控件没有统一分组。固定区域占128逻辑像素,常驻版本/请求解释和大号还原按钮,实际可操作区偏小。用户必须记住参数位置并反复滚动,部分下拉框仅靠选项内容说明用途。
+
+本方案的目标是:先找到功能,再调整参数。保持日常模式、玻璃视觉和视频区域布局;不以缩小字体和隐藏常用设置腾空间。重排不改变增强顺序、参数含义或算法。
+
+## 面板结构
+
+专业面板采用六个固定分类,窄面板也完整显示,不做横向隐藏滚动:
+
+```text
+画质 补帧 声音
+显示 预设 导出
+--------------------------------
+当前分类标题 重置本页
+本分类常用设置
+本分类精细设置
+```
+
+六个分类使用两行三列、同宽按钮,位置始终固定。分类条总高约72逻辑像素。取消当前常驻两段技术提示,正常状态只保留一行“已生效 / 应用中 / 失败已恢复”。错误出现时展示原因,不用请求revision数字占主操作区;revision等移至诊断。全局还原默认保留在预设页,旁边明确作用范围。
+
+| 分类 | 常用区域 | 后续区域 |
+| --- | --- | --- |
+| 画质 | 超分开关、算法、目标尺寸、质量;NR开关、运行版本、处理尺寸 | NR强度与局部调整、NR保护区域、残差细调、实验参数 |
+| 补帧 | 补帧方式、倍率、内容帧率策略 | 光流来源与质量、AMD半尺寸选项;不再放声音 |
+| 声音 | 同步方式、手动偏移、音量 | 音画偏差和设备恢复状态;当前没有的设备选择不伪造 |
+| 显示 | 直播兼容模式、适应窗口/原始比例、全屏 | 原画/增强对比、分屏;明确区别于导出目标尺寸 |
+| 预设 | 当前预设、保存、另存为、载入 | 重命名、删除、启动默认、还原全部默认 |
+| 导出 | 格式、位置、开始导出 | 进度、暂停/取消、优先观看、限制说明 |
+
+画质页再提供固定的“超分 / NR / 保护 / 细调”段落定位入口。点击滚动到对应段落,不另建四个深层页面,段落始终保持相同顺序。各分类记住自己的滚动位置。
+
+## 画质页示意
+
+```text
+超分辨率 [开关]
+算法 [RTX 视频超分]
+目标尺寸 [2K] [4K] [8K]
+质量 [低][中][高][最高]
+
+NR 画面增强 [开关]
+运行版本 [NVIDIA 原版]
+处理尺寸 [实时] [原生]
+增强强度 1.00
+-------------------------------- 滑条
+
+NR保护区域 [开关]
+已选区域 0 / 4
+[框选] [清除]
+
+精细调整 [展开箭头]
+实验参数 [展开箭头]
+```
+
+算法、运行版本使用现有玻璃选择器,选项集较小的尺寸/质量/倍率采用分段按钮。只在选中RTX Video SR时显示其质量档位;选择DLSS SR时不留下无效质量控件。禁用的整组设置仍保留标题和当前值,以便找到并开启;不把常用设置默认收进高级区域。
+
+## 文案统一
+
+| 当前文字 | 建议文字 | 说明位置 |
+| --- | --- | --- |
+| 实验性 NVIDIA NR 增强 | NR 画面增强,旁附“实验”标记 | 悬停解释社区实验集成 |
+| NVIDIA 原版 · RTX 50 | NVIDIA 原版 | 选项副文案:RTX 50;社区版RTX 40/50需实机验证 |
+| 社区兼容 · RTX 40/50 实验 | 社区兼容版 | 实验标记与硬件验证范围保留 |
+| 实时NR · 约1080内部处理 | 实时 | 始终显示实际内部处理尺寸,不只写“1080” |
+| 原生NR · 高性能成本 | 原生 | 始终显示实际尺寸;性能成本放提示 |
+| NR / DLSS光流 · 性能/平衡/质量 | 运动估算质量 | 选项仅写性能、平衡、质量 |
+| 采集60→30fps处理(PS5 30帧) | 60Hz输入按30fps处理 | 提示说明这是处理策略,不是采集卡模式 |
+| 采集音频同步 | 音画同步 | 文件和采集都使用;实际能力差异在状态中说明 |
+| 增强变化量 | 增强混合 | 根据代码的残差含义逐项复核,不能写成锐化/降噪 |
+| 局部明暗 / 局部结构 | 保留当前名称 | 没有画质证据前不擅自赋予算法新含义 |
+| UI修正键 | UI修正(实验) | 与“NR保护区域”分开,不宣称可剔除游戏HUD |
+
+不在选择框里重复字段名和长解释。中文字段为主,NR、DLSS、XeSS保留用于识别算法;厂商/API/数据格式等放组件页或悬停。数值统一小数位,单位贴在值后;未知延迟显示“未测”,不用0冒充。
+
+## 实时状态
+
+实时处理状态保留独立区域,首屏优先显示:源帧处理fps、有效补帧fps、显示提交fps、软件延迟。明确“软件延迟”测量起止;不得改叫包含采集卡和显示器的端到端总延迟。
+
+下方为可展开阶段耗时:取帧、颜色、超分、光流、NR、补帧、呈现;并列阶段不可直接相加冒充总耗时。实际生效的运行版本、显示模式及失败原因放在这里,不在参数页重复多处。
+
+## 尺寸与交互
+
+- 面板宽度延续296至420逻辑像素可拖动范围;14px主字段、12px次要文字、16px组标题,按DPI缩放,不按窗口宽度缩字。
+- 行高32至36,控件高度32,组间距16至20,标签到控件间距4至6;数值右对齐,长选项换到下一行。
+- 面板顶部固定分类和状态,不滚动;内容按分类独立滚动。数值框、滑条、选择器继续禁止滚轮改值。
+- 键盘Tab顺序与视觉顺序一致;焦点进入屏外控件时自动滚动定位。
+- 提供面板设置搜索:输入“40 / 直播 / 30帧 / 音画 / 超分”等可列出对应字段,选中后跳到分类和位置并短暂高亮。搜索不能替代可见分组。
+- 切换正在应用时显示“应用中”,失败显示恢复状态;避免进度文字刷新导致整块布局闪烁。
+
+## 实施顺序和验收
+
+1. 将绝对y偏移链改为各分类的顺序行布局;保持现有控件ID和回调,优先避免行为回归。
+2. 实施六分类及声音迁移、画质段落定位、每页滚动记忆。
+3. 整理文案、数字、单位及条件可用状态,再做搜索与状态压缩。
+4. 验证所有原有设置仍能找到、修改、保存和恢复;日常模式不新增专业参数堆叠。
+
+至少检查720x540、1040x540和1280x900,96/144/192 DPI下无重叠或截断,所有字段通过滚动和键盘可达。用户查找超分目标、NR版本、30fps处理、音画同步、直播兼容和导出,各自最多一次分类点击;画质细项最多再一次段落定位。实测交互和截图后才可称布局完成。
diff --git a/docs/RELEASE_0.0.3_EXECUTION.md b/docs/RELEASE_0.0.3_EXECUTION.md
new file mode 100644
index 00000000..0d2baa77
--- /dev/null
+++ b/docs/RELEASE_0.0.3_EXECUTION.md
@@ -0,0 +1,51 @@
+# 0.0.3 发布执行记录
+
+状态:构建和最终便携回归通过,待上传核对后另记实际发布结果。用户2026-09-11授权发布当前版本到 `Likely7/Veyra-NRVideo`,更新源码、中英文README和完整便携包,版本0.0.3;保持0.0.2资产与标签不变。
+
+## 范围
+
+收录当前NR双运行时、直播兼容实验开关、v10预设及MSVC/Ninja依赖修复。专业UI大改仅有方案,不标作已实现。捕获故障已由用户明确选用WGC恢复:本机OBS日志12:48:59自动选BitBlt,12:53:57手选WGC,用户反馈视频出现;据此README给正确捕获步骤,不追加软件提示、不宣称切换交换链解决该故障。
+
+## 二进制与源码隔离
+
+沿用0.0.2的六个增强运行文件、FFmpeg、Microsoft CRT、自有shader与许可证;额外包含本次用户指定并随当前版本发布的社区NR,路径 `runtime/experimental/nr-community/nvngx_dlssnr.dll`。社区文件SHA256 `984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014`、310.8.0.0、165840496字节、签名 `HashMismatch`;默认仍用签名有效的原版。
+
+打包脚本按文件检查来源hash和签名状态,仅指定社区文件允许指定HashMismatch,不普遍放宽其余文件审计。运行时不恢复身份锁。社区版来源是用户指定的本机文件,未修改或重签名;详细许可证位置见 `RUNTIME_COMPONENTS_0.0.3.md`,不把官方许可证解释为社区文件通用授权。
+
+仅Release包含运行二进制;源码、Git历史和LFS不包含SDK、运行DLL、模型、开发头文件/库或测试媒体。FFmpeg对应源码资料单独作为Release附件,按现有LGPL发布流程。
+
+## 计划与证据
+
+1. 同步版本/README/Release Notes/组件清单,构建独立 `out/build/release-0.0.3`,不覆盖正在运行的用户进程。
+2. 显式清单打包,生成SHA256和审计记录,在项目外解压并进行清洁PATH、无manifest启动与真实GPU、NR运行版本、显示开关和导出回归。
+3. 审计Git暂存与历史,提交源码,push到nrvideo/main并创建v0.0.3标签;上传草稿Release所有附件并比对digest/大小,再公开发布。
+
+## 最终候选验证
+
+全新目录174目标构建exit0,日志 `logs/release-003-build.log`。最终EXE产品版本0.0.3,SHA256 `D9C7DCCEA7B1538066CC648D7C8E0D5513439A367E0999A70E614556FAB6395C`。CPU合同81项通过、预设42组迁移及v1升级/完整字段往返通过。
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release -BuildDirectory out/build/release-0.0.3
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1 -Root . -Version 0.0.3 -BuildDirectory out/build/release-0.0.3 -OutputDirectory out/releases/0.0.3
+python scripts/package-ffmpeg-source.py --version 0.0.3 --prefix C:/veyra-deps/installed/x64-windows --vcpkg C:/veyra-deps/vcpkg --source C:/veyra-deps/vcpkg/buildtrees/ffmpeg/src/n9.0.1-1250e74153.clean --output out/releases/0.0.3/Veyra-0.0.3-FFmpeg-source.zip
+out/build/release-0.0.3/veyra_repair_preset_tests.exe logs/release-003-presets.v1
+out/build/release-0.0.3/veyra_repair_contract_tests.exe
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/acceptance/portable-smoke.ps1 -PackageDirectory "$env:TEMP/Veyra portable 003 verified/Veyra-0.0.3-win64-portable" -InputFile loop/local/fixed_clips/test_av_1080p.mp4 -OutputDirectory logs/release-003-portable
+python scripts/acceptance/ui-nr-runtime.py "$env:TEMP/Veyra portable 003 verified/Veyra-0.0.3-win64-portable/Veyra.exe" "$env:TEMP/Veyra portable 003 verified/Veyra-0.0.3-win64-portable/runtime/experimental/nr-community/nvngx_dlssnr.dll"
+python scripts/acceptance/ui-broadcast-mode.py "$env:TEMP/Veyra portable 003 verified/Veyra-0.0.3-win64-portable/Veyra.exe" --xess
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root . -BuildDirectory out/build/release-0.0.3 -PlayerExe "$env:TEMP/Veyra portable 003 verified/Veyra-0.0.3-win64-portable/Veyra.exe" -PortablePlayer
+```
+
+- 包外临时目录解压后,清空开发PATH并临时移走manifest,空窗口、基础播放、社区SR+NR+FG、原版SR+NR+FG、VideoSR+NR+FG全部exit0,`logs/release-003-portable/result.json`。确认两种NR实际模块路径分别指向包内原版和社区子目录。NR/DLSSG Create `0x1`、SEH0,有效执行和保存图像非黑;三张增强图均3840x2160,RGB标准差至少75。VSR沿用驱动NGX实现,不声称包内nvngx_vsr.dll在本机已映射。
+- 实际UI原版/社区往返及缺文件回退PASS,`logs/nr-runtime-switch/1789102928174822400/result.json`。实际XeSS开关与直播模式往返、暂停、全屏、总增强关闭和两尺寸布局PASS,`logs/broadcast-mode/1789102958375091400/result.json`。
+- 最终解压EXE参与delivery,23项PASS,47.474秒,`logs/delivery/cb1f9a5f77524603a6bd29d1d0f630e7/result.json`。覆盖NR/NVOF、原生4K正确性、播放暂停seek、图片保存、H264/HEVC含音轨和帧数/时间线、取消。没有将这些测试当作外部录制成功证据。
+- ZIP重开后检查所有51个manifest条目的大小和SHA256,成员集合恰为51个条目加package-manifest,共52文件;无额外文件。打包审计 `out/releases/0.0.3/package-audit.json` forbiddenFiles=0。
+
+| Release资产 | 大小 / SHA256 |
+| --- | --- |
+| Veyra-0.0.3-win64-portable.zip | 298999496 bytes;`3A37336BF09177A8224AA5F15C2FB9333AF5657F37F3B86411DD4AB0BC9E1D7B` |
+| Veyra-0.0.3-FFmpeg-source.zip | 23248643 bytes;`82D055AF7D335269EC87E859BBEC7C0973C65B72E7C7EF23A6F9A69335624D4D` |
+
+两ZIP另附各自.sha256文件。FFmpeg源码资料10442条,已核对vcpkg SPDX与所发DLL的LGPL配置,不含NVIDIA SDK。Git已跟踪文件和历史对象按名称/体积审计未发现运行DLL/SDK/模型/开发ZIP;历史存在已移除的合成测试MP4,不是本次新增发布文件。
+
+单次测试均小于300秒;本轮发布候选未出现构建/回归失败,之前功能开发失败保留在对应方案。未新增RTX40实机、实卡端到端延迟、外部录制节奏或长期压力测试。不会把本机5070通过扩展成全系列验收。
diff --git a/docs/RELEASE_NOTES_0.0.3.md b/docs/RELEASE_NOTES_0.0.3.md
new file mode 100644
index 00000000..3107e95e
--- /dev/null
+++ b/docs/RELEASE_NOTES_0.0.3.md
@@ -0,0 +1,49 @@
+# Veyra 0.0.3
+
+## 中文
+
+### 更新
+
+- 新增 NR 运行版本选择:NVIDIA 原版默认启用,可切换到随包附带的 RTX 40/50 社区兼容实验版,无需覆盖 DLL。
+- 运行版本设置随预设保存;播放中切换会重建增强管线,失败恢复上一套设置。图片处理和视频导出使用所选 NR 版本。
+- 新增“直播兼容 · 实验”显示开关,默认关闭;可以在标准和实验交换链之间切换,不检测或依赖特定直播软件。
+- 实时处理状态显示已应用的 NR 版本与显示模式。旧预设升级后默认使用原版 NR 和标准显示。
+- 修复部分中文 MSVC/Ninja 环境无法跟踪头文件依赖的问题,避免增量构建混用不同设置结构导致启动崩溃。
+- 更新中英文 README、运行组件说明和 OBS 采集教程。
+
+### 下载与使用
+
+普通用户只需下载 **Veyra-0.0.3-win64-portable.zip**,完整解压后运行 **Veyra.exe**。不需要另装SDK。FFmpeg-source.zip 是开源依赖的对应源码资料,普通用户不需要下载。
+
+OBS 请使用“窗口采集”,把捕获方式明确设为 **Windows 10(1903及以上)**。“自动”可能选到 BitBlt,只能看到UI;切换上述方式已在反馈场景中恢复视频。直播兼容开关不能替代正确的捕获方式。
+
+### 验证边界
+
+- 两种NR运行版本在RTX5070上已运行;RTX40实机验证仍待完成,社区版不保证覆盖所有显卡或驱动。
+- 社区NR为修改版,Authenticode状态为 **HashMismatch**。原版与社区版独立存放;文件版本、哈希、来源与卸载方式见包内组件文档及manifest。
+- NR和DLSS补帧属于 **community experimental / 社区实验集成**,不是厂商官方认证或完整原生游戏集成。软件继续允许用户自行替换DLL,不设置固定哈希启动锁。
+- 未承诺降低NR耗时、所有录屏工具兼容、长期直播稳定性或生成帧捕获节奏。专业模式整体布局调整本版尚未实施。
+- 预设升级为v10;升级前可备份设置,旧软件无法读取新格式预设。
+
+## English
+
+### Changes
+
+- Added NR runtime selection: keep the NVIDIA original as default or select the bundled community RTX 40/50 experimental variant without replacing DLLs.
+- Saved the selection in presets and propagated it to playback, image processing, and video export. Runtime changes rebuild the enhancement graph; failed changes restore the previous settings.
+- Added an optional experimental broadcast presentation mode, off by default, without detecting a specific recording application.
+- Added applied NR/runtime and presentation-mode status. Older presets migrate to the original NR runtime and standard presentation.
+- Fixed MSVC/Ninja header-dependency detection on localized Windows installations, preventing stale object files and startup crashes after incremental builds.
+- Updated bilingual documentation, component records, and OBS capture instructions.
+
+### Download and Capture
+
+Download **Veyra-0.0.3-win64-portable.zip**, extract it fully, and run **Veyra.exe**. No SDK installation is required. The separate FFmpeg-source.zip contains corresponding source material for the open-source dependency; it is not needed to run Veyra.
+
+In OBS Window Capture, explicitly select **Windows 10 (1903 and up)**. Automatic can select BitBlt and capture only the controls. The experimental swapchain switch does not fix BitBlt capture.
+
+### Limits
+
+Both NR variants have been exercised on an RTX 5070; RTX 40 hardware validation remains pending. The community NR DLL is modified and reports **HashMismatch**, not a valid NVIDIA signature. See the included component documentation and manifests for identities, locations, and removal instructions. Runtime replacement remains permitted.
+
+NR and DLSS frame generation are community-experimental integrations, not vendor certification. This release does not claim improved NR throughput, universal recorder compatibility, long-session streaming validation, or verified capture cadence for generated frames. The proposed Professional-mode layout redesign is not included. Presets now use schema v10; back up settings before upgrading if an older version must remain usable.
diff --git a/docs/RUNTIME_COMPONENTS_0.0.3.md b/docs/RUNTIME_COMPONENTS_0.0.3.md
new file mode 100644
index 00000000..86d88575
--- /dev/null
+++ b/docs/RUNTIME_COMPONENTS_0.0.3.md
@@ -0,0 +1,51 @@
+# Veyra 0.0.3 Runtime Components
+
+发布包组件清单 / Shipped components. NVIDIA/Intel DLLs are separate Release assets, never source Git content. NR and DLSS FG are community-experimental integrations, not vendor endorsement or certification.
+
+## Locations and Replacement
+
+NVIDIA components: `runtime/experimental/`. XeSS/XeLL: `runtime_local/intel/experimental/`. Exit Veyra before replacing a DLL and preserve its filename. No runtime hash, signature, or manifest lock is enforced. Manifests describe the original package only; users do not need to edit them after replacement. ABI/API and hardware compatibility still determine whether a feature works.
+
+允许自行替换DLL,但替换不代表兼容。出现初始化错误时还原原件或关闭对应增强。清单是发布记录,不是加载锁。退出软件并删除解压目录即可卸载;需要保留设置时先备份`runtime_local`中的设置文件。移除某个增强DLL会使对应功能不可用。
+
+## NVIDIA and Intel
+
+The six original publisher-provided DLLs below have valid Authenticode signatures. The additional community NR variant does NOT: its recorded status is `HashMismatch`. Names and SHA256 describe the approved files used to build this release. The JSON manifests also record file size, signer, source category, and removability.
+
+| File | Fixed file version | Source / use |
+| --- | --- | --- |
+| nvngx_dlss.dll | 310.7.0.0 | Official DLSS SDK 310.7.0 release runtime; DLSS SR |
+| nvngx_dlssg.dll | 310.7.0.0 | DLSS SDK release runtime; experimental Veyra DLSS FG integration |
+| nvngx_dlssnr.dll | 310.8.0.0 | User-provided pinned experimental NR runtime; 165840496 bytes |
+| nvngx_vsr.dll | 1.6.0.0 | RTX Video SDK 1.1.0; RTX Video SR |
+| libxess_fg.dll | 1.3.1.78 | Official Intel XeSS SDK 3.0.2; preview FG |
+| libxell.dll | 1.3.2.10 | Official Intel XeSS SDK 3.0.2; XeLL timing |
+
+```text
+nvngx_dlss.dll BE6E434A94CA32499515EB62CA0E6C274526055D568D0426E4C652DCDFB6EE6E
+nvngx_dlssg.dll 135EAF0733C1E37381A8C28ABCF7A862404A54132B81787C04E35D09EFC5E36F
+nvngx_dlssnr.dll E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E
+nvngx_vsr.dll C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED
+libxess_fg.dll EC5E0C65E075570C6EDE72618BB666D0BE0C2E10B2EA9762C0FE8CB8E375AB27
+libxell.dll D2030DCD694FDA8F2EC7E044B13E6DB8F0B56D4BA9113A5EFAD334E3F3DED8C7
+```
+
+NVIDIA license files: `licenses/NVIDIA_RTX_SDK_LICENSE.txt`, `NVIDIA_RTX_VIDEO_SDK_LICENSE.pdf`, `NVIDIA_OPTICAL_FLOW_SDK_LICENSE.pdf`. Intel terms: `licenses/INTEL_XESS_LICENSE.txt`, `INTEL_THIRD_PARTY_PROGRAMS.txt`. Experimental NR distribution follows the publisher's explicitly approved Release-only policy; the included official SDK terms are not a claim that the experimental runtime has a general redistribution grant.
+
+## Community NR Variant
+
+The user-selected community NR file is also included, unmodified, in `runtime/experimental/nr-community/nvngx_dlssnr.dll`. Source category: user-provided community-modified RTX40/RTX50 runtime. File version: 310.8.0.0. Size: 165840496 bytes. SHA256: `984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014`. Authenticode: **HashMismatch**; retained signer metadata does not make this a valid NVIDIA signature.
+
+社区版为用户指定的实验文件,本次明确授权随Release分发;与原版独立存放,默认仍选原版。不能把NVIDIA SDK许可证解释为对社区修改文件的通用授权。未修改、重签名或隐藏该文件。要移除社区版,先切回原版、退出Veyra,再删除`nr-community`目录;主包manifest仅为发布记录,无需修改。RTX40实机兼容性未验证,不将本机RTX5070结果扩大为全系列支持。
+
+Both variants are recorded with distinct paths in `runtime/experimental/release-runtime-manifest.json`. Delete only the community subdirectory to remove that variant. Neither DLL, the SDKs, nor models are part of source Git history.
+
+## Other Dependencies
+
+- FFmpeg 9.0.1#1: `avcodec-63.dll`, `avformat-63.dll`, `avutil-61.dll`, `swresample-7.dll`, `swscale-10.dll`; LGPL configuration. Full notices and source provenance are in `licenses/FFMPEG-COPYRIGHT.txt`, `FFMPEG-SPDX.json`, and [BUILD.md](BUILD.md).
+- Microsoft `vcruntime140.dll`, `vcruntime140_1.dll`, `msvcp140.dll`: application-local x64 Visual C++ redistributables from the Visual Studio Redistributables directory; needed by FFmpeg and XeSS. Windows11 supplies UCRT.
+- AMD FidelityFX optical flow: linked into Veyra, no AMD runtime DLL or NR model required. MIT terms in `licenses/AMD_FIDELITYFX_LICENSE.txt`.
+- Lucide icon paths: built into Veyra, with ISC/MIT terms in `licenses/LUCIDE-LICENSE.txt`.
+- Own compiled shader files: `shaders/*.dxil`. No local SDK headers or samples are required at runtime.
+
+GPU drivers supply `nvofapi64.dll` and `nvEncodeAPI64.dll`; they are not redistributed. ReShade/RenoDX add-ons, FRUC, SDK archives, development libraries, depth weights, and AMD NR networks are not part of this package.
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 650358f1..ed2439c8 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,31 @@
# 2026-09-11 继续修复目标模式执行中
+## 最新交付:0.0.3 发布候选通过,开始上传
+
+用户授权更新 `Likely7/Veyra-NRVideo` 源码和0.0.3便携包。中英文README已补OBS窗口采集手动选择Windows 10(1903及以上)的方法;用户实测恢复视频,OBS日志确认由BitBlt改WGC,未继续修改软件提示。0.0.3包含双NR运行版本、直播实验开关、v10预设和中文MSVC/Ninja依赖修复;专业UI大改仍仅为方案。
+
+全新构建174目标通过;最终EXE `D9C7DCCEA7B1538066CC648D7C8E0D5513439A367E0999A70E614556FAB6395C`。CPU81项、预设42组、项目外解压清洁PATH/无manifest五条路线、两种NR实际包内路径、UI切换与回退、XeSS/直播开关、最终delivery23项47.474秒全部通过。NR/DLSSG Create0x1/SEH0,实际GPU执行及4K非黑保存通过。日志 `logs/release-003-portable`、`logs/delivery/cb1f9a5f77524603a6bd29d1d0f630e7`。
+
+包298999496字节,SHA256 `3A37336BF09177A8224AA5F15C2FB9333AF5657F37F3B86411DD4AB0BC9E1D7B`,52文件逐项审计通过。社区DLL按用户本次发布决定列入Release manifest,标明HashMismatch,与原版独立;SDK/DLL/模型不进源码Git。完整命令与范围见 [0.0.3执行记录](RELEASE_0.0.3_EXECUTION.md)。RTX40、真实设备长期/音画/录制节奏未新增验收,远端发布结果另记。
+
+## 最新交付:直播兼容实验开关与专业UI布局方案
+
+按用户最新决定,撤回全局FLIP_SEQUENTIAL和OBS进程检测,默认FLIP_DISCARD;专业参数顶部“还原默认”右侧新增固定“直播兼容 · 实验”开关,勾选切FLIP_SEQUENTIAL。即时设置事务排空/重建,模式GetDesc1实查,总增强关闭仍可单独切换,v10预设保存。实际状态明确显示显示模式;不把开关生效标作第三方捕获成功。专业模式重排只给方案,尚未实施。
+
+标准入口已构建,SHA256 `041A14751E182936B21A8878AE7C3508C96EF9009FA9C1D05171121315A82F74`。CPU81项、预设42组通过;实际RTX5070 NR/DLSSG Create0x1/SEH0,DLSS和XeSS两种UI往返、暂停/全屏/总增强关闭和两尺寸布局通过。delivery23项42.881秒通过,`logs/delivery/e6eb77b2bcc5468781d458f7e5371e77`。命令、失败和未测项见 [直播兼容执行记录](BROADCAST_COMPATIBILITY_PLAN_2026-09-11.md),[专业UI布局方案](PROFESSIONAL_UI_LAYOUT_PLAN_2026-09-11.md)含六分类、文案和验收标准。
+
+前序“FLIP_DISCARD子窗口就是捕获失败根因”缺乏直接捕获证据,本轮不继续作为事实传播。没有验证外部软件捕获、实卡、社区NR组合和超大图片专项,不宣称已降低占用或已解决捕获故障。下一步用户用同一捕获源切换对照;未push/发布,DLL/SDK仍隔离。
+
+## 最新交付:原版与RTX40/50社区NR运行版本切换
+
+入口补交付:用户截图未见选项,查到两个运行窗口均来自旧 `out/build/x64-release/veyra.exe`,初次仅提供隔离构建链接不够。旧进程随后已退出,未强杀;已清理标准构建目标并完整重建174目标exit0,根目录 `Veyra.cmd` 现在打开新版。标准EXE SHA256 `4AB989BC9223F8EE821CF449CE7A0F2DE14C49F7C3C08E1ECC4299DC411E88D4`,原位置再次实际UI切换/回退/两尺寸布局PASS,`logs/nr-runtime-switch/1789100030646506400/result.json`,构建日志 `logs/nr-runtime-default-entry-build.log`。此条取代下文“旧入口未替换”的初次交付状态,GitHub资产仍未更新。
+
+专业模式增强页新增“NR 运行版本”,默认原版,可手动选择用户提供的RTX40/50社区实验版。两份DLL保留独立目录;设置事务重建和失败回退、预设v9、实际运行状态、播放/采集/分块图片/视频导出已接入。社区文件SHA256 `984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014`,签名HashMismatch,原样保存在忽略目录,不称有效签名原版。
+
+本机RTX5070实际社区Init/CreateFeature18 `0x1`、SEH0,播放239次NR且输出非黑;实际UI往返和缺文件回退通过;社区SR+NR+FG导出4K/120fps含12源帧、11生成、1显式CFR补齐;独立worker社区NR导出120帧,前台继续运行。CPU81项、预设36组、delivery23项43.129秒通过。最终EXE SHA256 `6C3723B1E0F3E10BA456905E39F94824A7E650C5E10E28545201DFCE73A75976`,新版入口 `out/build/release-0.0.2-final/veyra.exe`,用户原进程和根目录旧启动入口未替换。
+
+同时修复实际发现的MSVC/Ninja中文头依赖前缀错误:旧增量构建漏编译设置结构使用方导致启动ABI崩溃。改为实际编译探针获取原始前缀后完整重建174目标,最终ExportJobManager记录13个头依赖。完整命令、修改文件、失败记录、日志与边界见 [NR双运行时交付记录](NR_RUNTIME_SWITCH_PLAN_2026-09-11.md)。RTX40真实硬件、实体采集卡及社区超大图片专项未执行,下一步为RTX40实机验收。没有push或替换0.0.2 Release,没有向Git加入DLL/SDK。
+
## 最新交付:0.0.2 便携发布与用户DLL替换
已发布:https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.2 。源码提交`a69a9df`及同名标签已推送,四个附件远端SHA256/大小逐项匹配;公开时间`2026-09-11T03:22:48Z`,`isDraft=false`。原`Veyra-DLSS-Video-Player`远端未更新。下文候选阶段的“另记实际结果”由本条闭环,随后仅提交发布记录。
diff --git a/include/veyra/engine/EnhancementSettings.h b/include/veyra/engine/EnhancementSettings.h
index 215fedfe..5b70c6e4 100644
--- a/include/veyra/engine/EnhancementSettings.h
+++ b/include/veyra/engine/EnhancementSettings.h
@@ -7,6 +7,14 @@
#include "veyra/pipeline/ResolutionPlan.h"
namespace veyra::engine {
enum class FrameGenerationBackend { Dlss, XeSS };
+enum class NrRuntime { Original, Community };
+constexpr std::string_view nrRuntimeName(NrRuntime runtime) {
+ switch(runtime) {
+ case NrRuntime::Original:return "NVIDIA-original";
+ case NrRuntime::Community:return "community-RTX40-RTX50";
+ }
+ return "unknown";
+}
enum class FlowQuality { Performance, Balanced, Quality };
enum class OpticalFlowBackend { Nvidia, AmdFidelityFx };
enum class ContentRate { Transport, Auto, Fps30, Fps50, Fps60, Capture60To30 };
@@ -57,6 +65,8 @@ struct EnhancementSettings {
ResidualSettings residual;
ProtectionSettings protection;
bool nr=true,sr=false;
+ NrRuntime nrRuntime=NrRuntime::Original;
+ bool captureCompatible=false;
pipeline::SrTarget srTarget=pipeline::SrTarget::Uhd4K;
uint32_t videoSrQuality=0; // 0 DLSS SR; 1–4 RTX Video SR
uint32_t multiplier=1;
@@ -88,6 +98,7 @@ struct EnhancementSettings {
auto range=[](float v,float hi){return std::isfinite(v)&&v>=0&&v<=hi;};
if(auto error=protection.validate();!error.empty())return error;
if(!revision)return "settingsRevision must be nonzero";
+ if(nrRuntime!=NrRuntime::Original&&nrRuntime!=NrRuntime::Community)return "invalid NR runtime";
if(audioSync<AudioSyncMode::Automatic||audioSync>AudioSyncMode::Off||audioOffsetMs<-250||audioOffsetMs>250)return "invalid audio sync setting";
if(!range(model.intensity,1)||!range(model.tone,1)||!range(model.structure,1))return "model parameter out of range";
if(model.skin!=-1&&!range(model.skin,2))return "skin parameter out of range";
diff --git a/include/veyra/engine/VideoPresenter.h b/include/veyra/engine/VideoPresenter.h
index d73a40d8..67e400f3 100644
--- a/include/veyra/engine/VideoPresenter.h
+++ b/include/veyra/engine/VideoPresenter.h
@@ -10,7 +10,7 @@ namespace veyra::sink { struct RgbaImage; }
namespace veyra::engine {
class VideoPresenter {
public:
- bool open(gfx::D3D12DeviceContext&, HWND, pipeline::EnhanceGraph&);
+ bool open(gfx::D3D12DeviceContext&, HWND, pipeline::EnhanceGraph&, bool captureCompatible=false);
bool present(gfx::D3D12DeviceContext&,gfx::CommandSlotRing&,pipeline::EnhanceGraph&,unsigned slot,bool generated,bool referencesValid=true,int comparison=0,bool baseReference=false,float split=.5f,pipeline::FrameIdentity identity={},PreviewView view={});
void close();
// Explicit integration-test capture only; never called by playback/export.
diff --git a/include/veyra/gfx/PresentSink.h b/include/veyra/gfx/PresentSink.h
index b365e3bb..1c6016fc 100644
--- a/include/veyra/gfx/PresentSink.h
+++ b/include/veyra/gfx/PresentSink.h
@@ -1,7 +1,7 @@
#pragma once
// PresentSink (Playbook P6.3): a Win32 window plus a DXGI flip-model
-// (FLIP_DISCARD, 3-buffer) swapchain used as the display output of the
+// (FLIP_DISCARD by default, optional FLIP_SEQUENTIAL, 3-buffer) swapchain used as the display output of the
// Veyra engine. The normal path NEVER reads back: the engine blits the
// finished frame (Feature 18 output, then FG, then UI) into the back buffer
// and presents. Resize recreates the buffers; vsync can be disabled for
@@ -35,6 +35,7 @@ public:
uint32_t height = 720;
bool vsync = true;
bool xess = false;
+ bool captureCompatible = false;
// Probe runs create their own window class name per process.
std::wstring title = L"Veyra";
HWND targetWindow = nullptr; // borrowed UI-owned child HWND; never destroyed by sink
diff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.h
index 0aa4f1a4..3fa36e5b 100644
--- a/include/veyra/pipeline/EnhanceGraph.h
+++ b/include/veyra/pipeline/EnhanceGraph.h
@@ -61,6 +61,7 @@ struct EnhanceGraphDesc {
uint32_t videoSrQuality=0;
bool enableSr = false; // upscale source -> work extent (1:1 bypass otherwise)
bool enableNr = true;
+ engine::NrRuntime nrRuntime=engine::NrRuntime::Original;
bool enableFg = true;
bool validateMotion = true; // disable only in isolated legacy A/B diagnostics
bool enableNvofStandalone = false; // run NVOF+densify per frame without FG (quality core)
diff --git a/scripts/acceptance/portable-smoke.ps1 b/scripts/acceptance/portable-smoke.ps1
index aa829086..f7fbdbcc 100644
--- a/scripts/acceptance/portable-smoke.ps1
+++ b/scripts/acceptance/portable-smoke.ps1
@@ -15,6 +15,7 @@ try {
foreach($case in @(
@{name='empty';args=@('--smoke-empty','--no-nr','--no-sr','--no-fg');modules=@()},
@{name='baseline';args=@($inputPath,'--no-nr','--no-sr','--no-fg');modules=@()},
+ @{name='community-sr-nr-fg';args=@($inputPath,'--nr-community','--sr','--nr','--fg','--realtime');modules=@('nvngx_dlss.dll','nvngx_dlssnr.dll','nvngx_dlssg.dll')},
@{name='dlss-sr-nr-fg';args=@($inputPath,'--sr','--nr','--fg','--realtime');modules=@('nvngx_dlss.dll','nvngx_dlssnr.dll','nvngx_dlssg.dll')},
@{name='video-sr-nr-fg';args=@($inputPath,'--video-sr','1','--nr','--fg','--realtime');modules=@('nvngx_dlssnr.dll','nvngx_dlssg.dll')}
)) {
@@ -45,6 +46,11 @@ try {
foreach($module in @('avcodec-63.dll','avformat-63.dll','avutil-61.dll','swresample-7.dll','swscale-10.dll','vcruntime140.dll')+$case.modules){
if(-not $loaded.ContainsKey($module) -or -not $loaded[$module].StartsWith($package+'\',[StringComparison]::OrdinalIgnoreCase)){throw "$name missing app-local module $module ($($loaded[$module]))"}
}
+ if($case.modules -contains 'nvngx_dlssnr.dll'){
+ $nrFolder=if($name -eq 'community-sr-nr-fg'){'runtime/experimental/nr-community'}else{'runtime/experimental'}
+ $expectedNr=[IO.Path]::GetFullPath((Join-Path $package "$nrFolder/nvngx_dlssnr.dll"))
+ if(-not [StringComparer]::OrdinalIgnoreCase.Equals($loaded['nvngx_dlssnr.dll'],$expectedNr)){throw "$name loaded the wrong NR variant"}
+ }
$results.Add(@{name=$name;exit=$p.ExitCode;frames=$frames;generated=$generated;seconds=$timer.Elapsed.TotalSeconds;modules=$loaded})
}
@{passed=$true;manifestRequired=$false;exeHash=(Get-FileHash -LiteralPath $exe).Hash;cases=$results}|ConvertTo-Json -Depth 6|Set-Content -LiteralPath "$output/result.json" -Encoding UTF8
diff --git a/scripts/acceptance/ui-broadcast-mode.py b/scripts/acceptance/ui-broadcast-mode.py
new file mode 100644
index 00000000..96d69d92
--- /dev/null
+++ b/scripts/acceptance/ui-broadcast-mode.py
@@ -0,0 +1,157 @@
+"""Exercise the broadcast presentation switch and its fixed professional control."""
+import ctypes as c
+from ctypes import wintypes as w
+import hashlib
+import json
+import os
+from pathlib import Path
+import re
+import subprocess
+import sys
+import time
+from PIL import ImageGrab, ImageStat
+
+if '--worker' not in sys.argv:
+ child = subprocess.Popen([sys.executable, __file__, '--worker', *sys.argv[1:]])
+ try:
+ sys.exit(child.wait(timeout=100))
+ except subprocess.TimeoutExpired:
+ subprocess.run(['taskkill', '/PID', str(child.pid), '/T', '/F'], capture_output=True, timeout=5)
+ sys.exit('Broadcast test exceeded 100 seconds')
+sys.argv.remove('--worker')
+exe = Path(sys.argv[1]).resolve()
+out = Path('logs/broadcast-mode') / str(time.time_ns())
+out.mkdir(parents=True)
+env = os.environ.copy()
+env['VEYRA_LOG_FILE'] = str((out / 'app.log').resolve())
+u = c.WinDLL('user32', use_last_error=True)
+u.SetProcessDpiAwarenessContext.argtypes = [w.HANDLE]
+u.SetProcessDpiAwarenessContext(c.c_void_p(-4))
+u.GetDlgItem.argtypes = [w.HWND, c.c_int]; u.GetDlgItem.restype = w.HWND
+u.PostMessageW.argtypes = [w.HWND, w.UINT, w.WPARAM, w.LPARAM]
+u.GetWindowRect.argtypes = [w.HWND, c.POINTER(w.RECT)]
+u.GetWindowTextW.argtypes = [w.HWND, w.LPWSTR, c.c_int]
+u.SetWindowPos.argtypes = [w.HWND, w.HWND, c.c_int, c.c_int, c.c_int, c.c_int, w.UINT]
+u.ShowWindow.argtypes = [w.HWND, c.c_int]
+u.SendMessageTimeoutW.argtypes = [w.HWND, w.UINT, w.WPARAM, w.LPARAM, w.UINT, w.UINT, c.POINTER(c.c_size_t)]
+visit_type = c.WINFUNCTYPE(w.BOOL, w.HWND, w.LPARAM)
+
+def send(hwnd, message, first=0, second=0):
+ result = c.c_size_t()
+ if not u.SendMessageTimeoutW(hwnd, message, first, second, 2, 1500, c.byref(result)):
+ raise RuntimeError('window message timeout')
+ return result.value
+
+def windows(class_name, parent=None):
+ result = []
+ @visit_type
+ def visit(hwnd, unused):
+ owner = w.DWORD(); name = c.create_unicode_buffer(128)
+ u.GetWindowThreadProcessId(hwnd, c.byref(owner)); u.GetClassNameW(hwnd, name, 128)
+ if owner.value == process.pid and name.value == class_name: result.append(hwnd)
+ return True
+ if parent: u.EnumChildWindows(parent, visit, 0)
+ else: u.EnumWindows(visit, 0)
+ return result
+
+def wait(action, seconds=15):
+ end = time.monotonic() + seconds
+ while time.monotonic() < end:
+ result = action()
+ if result: return result
+ if process.poll() is not None: raise RuntimeError('application exited')
+ time.sleep(.05)
+ raise RuntimeError('condition timeout')
+
+def rect(hwnd):
+ r = w.RECT(); assert u.GetWindowRect(hwnd, c.byref(r))
+ return [r.left, r.top, r.right, r.bottom]
+
+def text(hwnd):
+ b = c.create_unicode_buffer(1024); u.GetWindowTextW(hwnd, b, len(b)); return b.value
+
+def log():
+ path = out / 'app.log'
+ return path.read_text(encoding='utf-8', errors='replace') if path.exists() else ''
+
+
+result = {'exeHash': hashlib.sha256(exe.read_bytes()).hexdigest(), 'switches': [], 'layouts': []}
+with (out / 'stdout.log').open('w') as stdout, (out / 'stderr.log').open('w') as stderr:
+ process = subprocess.Popen([str(exe), str(Path('loop/local/fixed_clips/test_av_1080p.mp4').resolve()),
+ '--nr', '--no-sr', '--fg', '--smoke-view', 'professional', '--smoke-seconds', '90'],
+ env=env, stdout=stdout, stderr=stderr)
+ try:
+ main = wait(lambda: windows('VeyraApp'))[0]
+ u.ShowWindow(main, 4)
+ panel = wait(lambda: windows('VeyraInspector', main))[0]
+ body = windows('VeyraInspectorBody', panel)[0]
+ toggle = u.GetDlgItem(panel, 219)
+ label = u.GetDlgItem(panel, 400)
+ assert toggle
+ wait(lambda: 'swapEffect=flip-discard' in log() and 'player-timing' in log())
+ if '--xess' in sys.argv:
+ start = len(log())
+ backend = u.GetDlgItem(body, 208)
+ send(backend, 0x14E, 1)
+ send(panel, 0x111, 208 | (1 << 16), backend)
+ wait(lambda: 'Applied revision=' in log()[start:] and 'fgBackend=XeSS' in log()[start:])
+ result['backend'] = 'XeSS'
+ for width, height in [(1280, 900), (1040, 540)]:
+ u.SetWindowPos(main, None, 30, 30, width, height, 0x14)
+ time.sleep(.3)
+ a, b, v = rect(u.GetDlgItem(panel, 211)), rect(toggle), rect(panel)
+ assert a[2] <= b[0] and v[0] <= b[0] < b[2] <= v[2]
+ assert b[3] <= rect(body)[1], 'toggle must stay above scroll body'
+ send(body, 0x20A, ((-120) & 0xffff) << 16)
+ assert rect(toggle) == b, 'toggle moved during scroll'
+ result['layouts'].append(b)
+ def choose(enabled):
+ start = len(log())
+ before = text(label)
+ assert send(toggle, 0xF0) != int(enabled)
+ send(toggle, 0xF5)
+ effect = 'flip-sequential' if enabled else 'flip-discard'
+ wait(lambda: f'swapEffect={effect}' in log()[start:])
+ def applied():
+ current = text(label)
+ values = re.findall(r'\d+', current.splitlines()[0])
+ return current != before and len(values) >= 2 and values[0] == values[1]
+ wait(applied)
+ assert send(toggle, 0xF0) == int(enabled)
+ time.sleep(.4)
+ shot = ImageGrab.grab(bbox=tuple(rect(u.GetDlgItem(main, 1000))))
+ assert max(ImageStat.Stat(shot.convert('RGB')).stddev) > 10, 'blank video'
+ shot.save(out / f'video-{len(result["switches"])}.png')
+ result['switches'].append(effect)
+ choose(True)
+ send(u.GetDlgItem(main, 102), 0xF5)
+ choose(False)
+ send(u.GetDlgItem(main, 102), 0xF5)
+ before_master = text(label)
+ send(u.GetDlgItem(main, 221), 0xF5)
+ def bypass_applied():
+ current = text(label)
+ values = re.findall(r'\d+', current.splitlines()[0])
+ return current != before_master and len(values) >= 2 and values[0] == values[1]
+ wait(bypass_applied)
+ time.sleep(.4)
+ choose(True)
+ send(u.GetDlgItem(main, 120), 0xF5)
+ time.sleep(.4)
+ send(u.GetDlgItem(main, 120), 0xF5)
+ choose(False)
+ u.SetWindowPos(main, None, 30, 30, 1280, 900, 0x14)
+ time.sleep(.5)
+ ImageGrab.grab(bbox=tuple(rect(main))).save(out / 'professional.png')
+ result['passed'] = True
+ except Exception as error:
+ result.update(passed=False, error=str(error), status=text(label), warning=text(u.GetDlgItem(panel, 401)))
+ finally:
+ for hwnd in windows('VeyraApp'): u.PostMessageW(hwnd, 0x10, 0, 0)
+ try: process.wait(timeout=10)
+ except subprocess.TimeoutExpired: process.kill(); process.wait()
+ result['exit'] = process.returncode
+ result['passed'] = result.get('passed', False) and process.returncode == 0
+ (out / 'result.json').write_text(json.dumps(result, indent=2), encoding='utf-8')
+ print(out / 'result.json'); print(json.dumps(result))
+sys.exit(0 if result['passed'] else 1)
diff --git a/scripts/acceptance/ui-nr-runtime.py b/scripts/acceptance/ui-nr-runtime.py
new file mode 100644
index 00000000..f8e73052
--- /dev/null
+++ b/scripts/acceptance/ui-nr-runtime.py
@@ -0,0 +1,161 @@
+"""Exercise NR runtime changes, rollback, and the actual professional selector."""
+import ctypes as c
+from ctypes import wintypes as w
+import hashlib
+import json
+import os
+from pathlib import Path
+import re
+import subprocess
+import sys
+import time
+from PIL import ImageGrab, ImageStat
+
+if '--worker' not in sys.argv:
+ child = subprocess.Popen([sys.executable, __file__, '--worker', *sys.argv[1:]])
+ try:
+ sys.exit(child.wait(timeout=100))
+ except subprocess.TimeoutExpired:
+ subprocess.run(['taskkill', '/PID', str(child.pid), '/T', '/F'], capture_output=True, timeout=5)
+ sys.exit('NR switch test exceeded 100 seconds')
+sys.argv.remove('--worker')
+exe = Path(sys.argv[1]).resolve()
+community = Path(sys.argv[2]).resolve()
+hidden = community.with_suffix('.dll.test-disabled')
+assert community.is_file() and not hidden.exists()
+out = Path('logs/nr-runtime-switch') / str(time.time_ns())
+out.mkdir(parents=True)
+env = os.environ.copy()
+env['VEYRA_LOG_FILE'] = str((out / 'app.log').resolve())
+u = c.WinDLL('user32', use_last_error=True)
+u.SetProcessDpiAwarenessContext.argtypes = [w.HANDLE]
+u.SetProcessDpiAwarenessContext(c.c_void_p(-4))
+u.GetDlgItem.argtypes = [w.HWND, c.c_int]; u.GetDlgItem.restype = w.HWND
+u.PostMessageW.argtypes = [w.HWND, w.UINT, w.WPARAM, w.LPARAM]
+u.GetWindowRect.argtypes = [w.HWND, c.POINTER(w.RECT)]
+u.GetWindowTextW.argtypes = [w.HWND, w.LPWSTR, c.c_int]
+u.SetWindowPos.argtypes = [w.HWND, w.HWND, c.c_int, c.c_int, c.c_int, c.c_int, w.UINT]
+u.ShowWindow.argtypes = [w.HWND, c.c_int]
+u.SendMessageTimeoutW.argtypes = [w.HWND, w.UINT, w.WPARAM, w.LPARAM, w.UINT, w.UINT, c.POINTER(c.c_size_t)]
+visit_type = c.WINFUNCTYPE(w.BOOL, w.HWND, w.LPARAM)
+
+def send(hwnd, message, first=0, second=0):
+ result = c.c_size_t()
+ if not u.SendMessageTimeoutW(hwnd, message, first, second, 2, 1500, c.byref(result)):
+ raise RuntimeError('window message timeout')
+ return result.value
+
+def windows(class_name, parent=None):
+ result = []
+ @visit_type
+ def visit(hwnd, unused):
+ owner = w.DWORD(); name = c.create_unicode_buffer(128)
+ u.GetWindowThreadProcessId(hwnd, c.byref(owner)); u.GetClassNameW(hwnd, name, 128)
+ if owner.value == process.pid and name.value == class_name: result.append(hwnd)
+ return True
+ if parent: u.EnumChildWindows(parent, visit, 0)
+ else: u.EnumWindows(visit, 0)
+ return result
+
+def wait(action, seconds=15):
+ end = time.monotonic() + seconds
+ while time.monotonic() < end:
+ result = action()
+ if result: return result
+ if process.poll() is not None: raise RuntimeError('application exited')
+ time.sleep(.05)
+ raise RuntimeError('condition timeout')
+
+def rect(hwnd):
+ r = w.RECT(); assert u.GetWindowRect(hwnd, c.byref(r))
+ return [r.left, r.top, r.right, r.bottom]
+
+def text(hwnd):
+ b = c.create_unicode_buffer(1024); u.GetWindowTextW(hwnd, b, len(b)); return b.value
+
+def log():
+ path = out / 'app.log'
+ return path.read_text(encoding='utf-8', errors='replace') if path.exists() else ''
+
+result = {'exeHash': hashlib.sha256(exe.read_bytes()).hexdigest(), 'switches': [], 'layouts': []}
+startup = subprocess.STARTUPINFO(); startup.dwFlags = 1; startup.wShowWindow = 0
+with (out / 'stdout.log').open('w') as stdout, (out / 'stderr.log').open('w') as stderr:
+ process = subprocess.Popen([str(exe), str(Path('loop/local/fixed_clips/test_av_1080p.mp4').resolve()),
+ '--nr-original', '--nr', '--no-sr', '--no-fg', '--smoke-view', 'professional', '--smoke-seconds', '90'],
+ env=env, stdout=stdout, stderr=stderr, startupinfo=startup)
+ try:
+ main = wait(lambda: windows('VeyraApp'))[0]
+ u.ShowWindow(main, 4)
+ panel = wait(lambda: windows('VeyraInspector', main))[0]
+ body = windows('VeyraInspectorBody', panel)[0]
+ wait(lambda: 'professional=true' in log())
+ selector = u.GetDlgItem(body, 218)
+ label = u.GetDlgItem(panel, 400)
+ assert selector and send(selector, 0x146) == 2
+ def reveal():
+ for unused in range(20):
+ r, v = rect(selector), rect(body)
+ if v[1] <= r[1] and r[3] <= v[3]: return
+ delta = 120 if r[1] < v[1] else -120
+ send(body, 0x20A, (delta & 0xffff) << 16)
+ raise RuntimeError('selector cannot be scrolled into view')
+ for width, height in [(1280, 900), (1040, 540)]:
+ u.SetWindowPos(main, None, 30, 30, width, height, 0x14); time.sleep(.25)
+ reveal()
+ r, v = rect(selector), rect(body)
+ assert v[1] <= r[1] < r[3] <= v[3], 'selector clipped'
+ assert rect(u.GetDlgItem(body, 1117))[3] <= r[1], 'label overlap'
+ result['layouts'].append({'selector': r, 'body': v})
+ previous_index = send(selector, 0x147)
+ send(selector, 0x20A, ((-120) & 0xffff) << 16)
+ assert send(selector, 0x147) == previous_index, 'wheel changed runtime'
+ send(body, 0x20A, 120 << 16)
+
+ def choose(index, rejected=False):
+ reveal()
+ previous = text(label)
+ start = len(log())
+ u.PostMessageW(selector, 0x201, 1, 12 | (12 << 16))
+ popup = wait(lambda: windows('VeyraGlassSelector'))[0]
+ listing = u.GetDlgItem(popup, 1)
+ send(listing, 0x186, index); u.PostMessageW(listing, 0x100, 0x0D, 0)
+ wait(lambda: not windows('VeyraGlassSelector'))
+ if rejected:
+ wait(lambda: send(selector, 0x147) == 0 and 'NR' in text(u.GetDlgItem(panel, 401)))
+ wait(lambda: 'staged DLL missing' in log()[start:])
+ result['switches'].append('missing community rejected; original restored')
+ return
+ def applied():
+ current = text(label); values = re.findall(r'\d+', current.splitlines()[0])
+ return current != previous and len(values) >= 2 and values[0] == values[1]
+ wait(applied)
+ expected = 'community-RTX40-RTX50' if index else 'NVIDIA-original'
+ wait(lambda: f'selected={expected}' in log()[start:] and 'Applied revision=' in log()[start:])
+ segment = log()[start:]
+ assert f'selected={expected}' in segment and 'Applied revision=' in segment
+ assert 'CreateFeature id=18 result=0x1' in segment
+ time.sleep(.5)
+ r = rect(u.GetDlgItem(main, 1000))
+ image = ImageGrab.grab(bbox=tuple(r))
+ assert max(ImageStat.Stat(image.convert('RGB')).stddev) > 10, 'blank video'
+ image.save(out / f'{len(result["switches"])}-{index}.png')
+ result['switches'].append(expected)
+
+ choose(1); choose(0)
+ community.rename(hidden)
+ try: choose(1, rejected=True)
+ finally: hidden.rename(community)
+ choose(1); choose(0)
+ result['passed'] = True
+ except Exception as error:
+ result.update(passed=False, error=str(error))
+ finally:
+ for hwnd in windows('VeyraApp'): u.PostMessageW(hwnd, 0x10, 0, 0)
+ try: process.wait(timeout=10)
+ except subprocess.TimeoutExpired: process.kill(); process.wait()
+ if hidden.exists(): hidden.rename(community)
+ result['exit'] = process.returncode
+ result['passed'] = result.get('passed', False) and process.returncode == 0
+ (out / 'result.json').write_text(json.dumps(result, indent=2), encoding='utf-8')
+ print(out / 'result.json'); print(json.dumps(result))
+sys.exit(0 if result['passed'] else 1)
diff --git a/scripts/package-ffmpeg-source.py b/scripts/package-ffmpeg-source.py
index 4688ffed..d3fde3ca 100644
--- a/scripts/package-ffmpeg-source.py
+++ b/scripts/package-ffmpeg-source.py
@@ -12,6 +12,7 @@ parser.add_argument('--prefix', type=Path, required=True)
parser.add_argument('--vcpkg', type=Path, required=True)
parser.add_argument('--source', type=Path, required=True)
parser.add_argument('--output', type=Path, required=True)
+parser.add_argument('--version', default='0.0.3')
args = parser.parse_args()
if args.output.exists():
raise SystemExit('Output exists; choose a new candidate')
@@ -50,7 +51,7 @@ with zipfile.ZipFile(args.output, 'x', compression=zipfile.ZIP_DEFLATED, compres
archive.writestr('binary-configuration.txt', license_name + '\n\n' + configuration + '\n')
archive.writestr('source-manifest.json', json.dumps(records, indent=2))
archive.writestr('README.txt',
- 'FFmpeg 9.0.1#1 corresponding-source material for Veyra 0.0.2.\n'
+ f'FFmpeg 9.0.1#1 corresponding-source material for Veyra {args.version}.\n'
'Not needed to run the application. No NVIDIA SDK or runtime is included.\n'
'ffmpeg-patched is the local vcpkg patched n9.0.1 source tree.\n'
'vcpkg-port contains the build recipe and patches, verified against the shipped SPDX.\n'
diff --git a/scripts/package-portable.ps1 b/scripts/package-portable.ps1
index ead23b7a..d9289cac 100644
--- a/scripts/package-portable.ps1
+++ b/scripts/package-portable.ps1
@@ -21,6 +21,7 @@ $runtimeFiles = @(
@{ Name='nvngx_dlss.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlss.dll'; Hash='BE6E434A94CA32499515EB62CA0E6C274526055D568D0426E4C652DCDFB6EE6E'; Category='official-dlss-sdk-310.7.0-rel'; Experimental=$false },
@{ Name='nvngx_dlssg.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlssg.dll'; Hash='135EAF0733C1E37381A8C28ABCF7A862404A54132B81787C04E35D09EFC5E36F'; Category='pinned-dlss-sdk-310.7.0-rel'; Experimental=$true },
@{ Name='nvngx_dlssnr.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlssnr.dll'; Hash='E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E'; Category='user-provided-pinned-experimental-runtime'; Experimental=$true },
+ @{ Name='nvngx_dlssnr.dll'; Folder='runtime/experimental/nr-community'; Source='runtime_local/nvidia/nr-community/nvngx_dlssnr.dll'; Hash='984BEE0F775C277D5829B8FD6775D53A7B0F75396C852B3AAF06A18375F81014'; Signature='HashMismatch'; Size=165840496; Version='310.8.0.0'; Category='user-provided-community-modified-RTX40-RTX50-runtime'; Experimental=$true },
@{ Name='nvngx_vsr.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_vsr.dll'; Hash='C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED'; Category='official-rtx-video-sdk-1.1.0'; Experimental=$false },
@{ Name='libxell.dll'; Folder='runtime_local/intel/experimental'; Source='runtime_local/intel/experimental/libxell.dll'; Hash='D2030DCD694FDA8F2EC7E044B13E6DB8F0B56D4BA9113A5EFAD334E3F3DED8C7'; Category='official-intel-xess-sdk-3.0.2'; Experimental=$true },
@{ Name='libxess_fg.dll'; Folder='runtime_local/intel/experimental'; Source='runtime_local/intel/experimental/libxess_fg.dll'; Hash='EC5E0C65E075570C6EDE72618BB666D0BE0C2E10B2EA9762C0FE8CB8E375AB27'; Category='official-intel-xess-sdk-3.0.2'; Experimental=$true }
@@ -30,8 +31,11 @@ $records = foreach ($item in $runtimeFiles) {
$file = Get-Item -LiteralPath $source
$hash = (Get-FileHash -LiteralPath $source -Algorithm SHA256).Hash
$sig = Get-AuthenticodeSignature -LiteralPath $source
- if ($hash -ne $item.Hash -or $sig.Status -ne 'Valid') { throw "Publisher runtime identity rejected: $($item.Name)" }
+ $expectedSignature = if ($item.ContainsKey('Signature')) { $item.Signature } else { 'Valid' }
+ if ($hash -ne $item.Hash -or $sig.Status.ToString() -ne $expectedSignature) { throw "Publisher runtime identity rejected: $($item.Source)" }
$v = $file.VersionInfo
+ $versionText = "$($v.FileMajorPart).$($v.FileMinorPart).$($v.FileBuildPart).$($v.FilePrivatePart)"
+ if (($item.ContainsKey('Size') -and $file.Length -ne $item.Size) -or ($item.ContainsKey('Version') -and $versionText -ne $item.Version)) { throw "Publisher runtime metadata rejected: $($item.Source)" }
[pscustomobject][ordered]@{name=$item.Name;path="$($item.Folder)/$($item.Name)";size=$file.Length;sha256=$hash;fileVersion="$($v.FileMajorPart).$($v.FileMinorPart).$($v.FileBuildPart).$($v.FilePrivatePart)";authenticode=$sig.Status.ToString();signer=$sig.SignerCertificate.Subject;classification=$item.Category;experimental=$item.Experimental;removable=$true;source=$item.Category}
}
$allowed = [Collections.Generic.List[string]]::new()
@@ -52,7 +56,7 @@ foreach ($name in @('vcruntime140.dll','vcruntime140_1.dll','msvcp140.dll')) {
Copy-Payload (Join-Path $crt.FullName "x64/Microsoft.VC143.CRT/$name") $name
}
foreach ($name in @('LICENSE','README.md','README_EN.md','THIRD_PARTY_NOTICES.md')) { Copy-Payload (Join-Path $resolvedRoot $name) $name }
-foreach ($name in @('BUILD.md','RUNTIME_COMPONENTS_0.0.2.md')) { Copy-Payload (Join-Path $resolvedRoot "docs/$name") "docs/$name" }
+foreach ($name in @('BUILD.md',"RUNTIME_COMPONENTS_$Version.md","RELEASE_NOTES_$Version.md")) { Copy-Payload (Join-Path $resolvedRoot "docs/$name") "docs/$name" }
Copy-Payload (Join-Path $resolvedRoot "docs/RELEASE_NOTES_$Version.md") 'RELEASE_NOTES.md'
foreach ($shader in Get-ChildItem -LiteralPath (Join-Path $bin 'shaders') -File -Filter '*.dxil') { Copy-Payload $shader.FullName "shaders/$($shader.Name)" }
Copy-Payload (Join-Path $resolvedRoot 'runtime_local/config/ngx-local.json') 'runtime/config/ngx-local.json'
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index 9d20e069..ce38d347 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -129,11 +129,11 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){
gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.nrWidth=resolution.nr.width;gd.nrHeight=resolution.nr.height;gd.flowWidth=resolution.flow.width;gd.flowHeight=resolution.flow.height;
const bool nvidiaAdapter=ctx.adapter().isNvidia;
const bool xessFg=options.settings.frameGenerationBackend==FrameGenerationBackend::XeSS;
- gd.enableSr=resolution.srApplied&&nvidiaAdapter;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr&&nvidiaAdapter;gd.enableFg=options.fg&&(nvidiaAdapter||xessFg);gd.fgMultiplier=options.fgMultiplier;gd.frameGenerationBackend=options.settings.frameGenerationBackend;gd.enableNvofStandalone=gd.enableNr;
+ gd.enableSr=resolution.srApplied&&nvidiaAdapter;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr&&nvidiaAdapter;gd.nrRuntime=options.settings.nrRuntime;gd.enableFg=options.fg&&(nvidiaAdapter||xessFg);gd.fgMultiplier=options.fgMultiplier;gd.frameGenerationBackend=options.settings.frameGenerationBackend;gd.enableNvofStandalone=gd.enableNr;
gd.noFeatures=false;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.contentRate=options.settings.content;
gd.opticalFlowBackend=options.settings.opticalFlowBackend;gd.amdFlowHalfResolution=options.settings.amdFlowHalfResolution;
gd.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();
- if(!graph.initialize(gd)||!presenter.open(ctx,window,graph)||!graph.createViews()){status(L"增强初始化失败,请核对本地运行时",true);break;}
+ if(!graph.initialize(gd)||!presenter.open(ctx,window,graph,options.settings.captureCompatible)||!graph.createViews()){status(L"增强初始化失败,请核对本地运行时",true);break;}
if(!nvidiaAdapter&&(options.nr||options.sr||(options.fg&&!xessFg))){
veyra::log::warn("capability",std::format("non-NVIDIA adapter disabled requested features: nr={} sr={} fgBackend={} flowBackend={}",options.nr,options.sr,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend)));
status(L"当前非 NVIDIA 适配器:NR、NVIDIA 超分与 DLSS 已禁用;可使用 XeSS 预览和 AMD 光流",false);
@@ -310,21 +310,21 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){
nextDesc.workWidth=plan.base.width;nextDesc.workHeight=plan.base.height;nextDesc.nrWidth=plan.nr.width;nextDesc.nrHeight=plan.nr.height;nextDesc.flowWidth=plan.flow.width;nextDesc.flowHeight=plan.flow.height;
const bool nvidiaAdapter=ctx.adapter().isNvidia;
const bool xessFg=next.settings.frameGenerationBackend==FrameGenerationBackend::XeSS;
- nextDesc.enableSr=plan.srApplied&&nvidiaAdapter;nextDesc.videoSrQuality=next.settings.videoSrQuality;nextDesc.enableNr=next.nr&&nvidiaAdapter;nextDesc.enableFg=next.fg&&(nvidiaAdapter||xessFg);nextDesc.fgMultiplier=next.fgMultiplier;nextDesc.frameGenerationBackend=next.settings.frameGenerationBackend;nextDesc.enableNvofStandalone=nextDesc.enableNr;
+ nextDesc.enableSr=plan.srApplied&&nvidiaAdapter;nextDesc.videoSrQuality=next.settings.videoSrQuality;nextDesc.enableNr=next.nr&&nvidiaAdapter;nextDesc.nrRuntime=next.settings.nrRuntime;nextDesc.enableFg=next.fg&&(nvidiaAdapter||xessFg);nextDesc.fgMultiplier=next.fgMultiplier;nextDesc.frameGenerationBackend=next.settings.frameGenerationBackend;nextDesc.enableNvofStandalone=nextDesc.enableNr;
nextDesc.model=requested.model;nextDesc.residual=requested.residual;nextDesc.protection=requested.protection;nextDesc.settingsRevision=requested.revision;nextDesc.flowQuality=requested.flow;nextDesc.contentRate=requested.content;
nextDesc.opticalFlowBackend=requested.opticalFlowBackend;nextDesc.amdFlowHalfResolution=requested.amdFlowHalfResolution;
- const bool rebuild=gd.opticalFlowBackend!=nextDesc.opticalFlowBackend||gd.amdFlowHalfResolution!=nextDesc.amdFlowHalfResolution||gd.enableNr!=nextDesc.enableNr||gd.enableFg!=nextDesc.enableFg||gd.frameGenerationBackend!=nextDesc.frameGenerationBackend||gd.fgMultiplier!=nextDesc.fgMultiplier||gd.videoSrQuality!=nextDesc.videoSrQuality||gd.flowQuality!=nextDesc.flowQuality||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||gd.nrWidth!=nextDesc.nrWidth||gd.nrHeight!=nextDesc.nrHeight||gd.flowWidth!=nextDesc.flowWidth||gd.flowHeight!=nextDesc.flowHeight;
+ const bool rebuild=previous.captureCompatible!=requested.captureCompatible||gd.nrRuntime!=nextDesc.nrRuntime||gd.opticalFlowBackend!=nextDesc.opticalFlowBackend||gd.amdFlowHalfResolution!=nextDesc.amdFlowHalfResolution||gd.enableNr!=nextDesc.enableNr||gd.enableFg!=nextDesc.enableFg||gd.frameGenerationBackend!=nextDesc.frameGenerationBackend||gd.fgMultiplier!=nextDesc.fgMultiplier||gd.videoSrQuality!=nextDesc.videoSrQuality||gd.flowQuality!=nextDesc.flowQuality||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||gd.nrWidth!=nextDesc.nrWidth||gd.nrHeight!=nextDesc.nrHeight||gd.flowWidth!=nextDesc.flowWidth||gd.flowHeight!=nextDesc.flowHeight;
bool accepted=ring.drainQueue();out={};hasOutput=false;
resetRecord->rebuilt=rebuild;
markResetStage(diagnostics::ResetStage::Drain);
if(!accepted){finishReset(diagnostics::ResetOutcome::Failed);status(L"设置切换排空失败,已停止",true);break;}
- if(accepted&&rebuild){presenter.close();graph.shutdown();markResetStage(diagnostics::ResetStage::Destroy);accepted=graph.initialize(nextDesc)&&presenter.open(ctx,window,graph)&&graph.createViews();
+ if(accepted&&rebuild){presenter.close();graph.shutdown();markResetStage(diagnostics::ResetStage::Destroy);accepted=graph.initialize(nextDesc)&&presenter.open(ctx,window,graph,requested.captureCompatible)&&graph.createViews();
markResetStage(diagnostics::ResetStage::Create);
if(accepted&&graph.xessEnabled()&&!presenter.xessActive()){
veyra::log::warn("settings","requested XeSS presenter unavailable; rejecting transaction and restoring previous backend");
accepted=false;
}
- if(!accepted){presenter.close();graph.shutdown();if(!graph.initialize(gd)||!presenter.open(ctx,window,graph)||!graph.createViews()){status(L"设置失败且旧资源恢复失败,已停止",true);break;}}
+ if(!accepted){presenter.close();graph.shutdown();if(!graph.initialize(gd)||!presenter.open(ctx,window,graph,options.settings.captureCompatible)||!graph.createViews()){status(L"设置失败且旧资源恢复失败,已停止",true);break;}}
}else if(accepted)accepted=graph.applySettings(requested);
if(accepted){
options=next;gd=nextDesc;transaction=true;reset=true;
@@ -333,7 +333,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){
}
else {
finishReset(diagnostics::ResetOutcome::RolledBack);
- std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,previous);snapshot_.desired=desired_;snapshot_.rejectedRevision=requested.revision;snapshot_.applying=desired_!=previous;snapshot_.status=L"设置应用失败,已恢复上一套参数";snapshot_.backendWarning=requested.frameGenerationBackend==FrameGenerationBackend::XeSS?L"XeSS 未能启用,已恢复上一套参数":L"后端切换失败,已恢复上一套参数";}
+ std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,previous);snapshot_.desired=desired_;snapshot_.rejectedRevision=requested.revision;snapshot_.applying=desired_!=previous;snapshot_.status=L"设置应用失败,已恢复上一套参数";snapshot_.backendWarning=requested.nrRuntime!=previous.nrRuntime?L"NR运行版本切换失败,已恢复上一套参数":requested.frameGenerationBackend==FrameGenerationBackend::XeSS?L"XeSS 未能启用,已恢复上一套参数":L"后端切换失败,已恢复上一套参数";}
}
if(stop_)break;
const double seek=seekSeconds_.exchange(-1);
@@ -435,7 +435,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){
if(transaction){
ring.drainQueue();out={};presenter.close();graph.shutdown();options=PlayerOptions::from(previous);
gd=previousDesc;
- if(graph.initialize(gd)&&presenter.open(ctx,window,graph)&&graph.createViews()&&graph.process(frame,pts,true,out,pkt.sequence,&pkt.colorInfo,comparisonMode_!=0)){
+ if(graph.initialize(gd)&&presenter.open(ctx,window,graph,options.settings.captureCompatible)&&graph.createViews()&&graph.process(frame,pts,true,out,pkt.sequence,&pkt.colorInfo,comparisonMode_!=0)){
finishReset(diagnostics::ResetOutcome::RolledBack);
std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,previous);snapshot_.desired=desired_;snapshot_.rejectedRevision=requested.revision;snapshot_.applying=desired_!=previous;snapshot_.status=L"参数执行失败,已整套回滚";transaction=false;
}else{status(L"参数回滚失败,已停止",true);break;}
diff --git a/src/engine/EngineControllerImage.cpp b/src/engine/EngineControllerImage.cpp
index e76a2f2a..47399f3a 100644
--- a/src/engine/EngineControllerImage.cpp
+++ b/src/engine/EngineControllerImage.cpp
@@ -24,7 +24,8 @@ void EngineController::runLargeImage(HWND window,const sink::RgbaImage& original
gfx::CommandSlotRing& ring;VideoPresenter& presenter;pipeline::EnhanceGraph& graph;
~Cleanup(){ring.drainQueue();presenter.close();graph.shutdown();}
} cleanup{ring,presenter,preview};
- if(!preview.initialize(previewDesc)||!presenter.open(ctx,window,preview)||!preview.createViews()){status(L"大图预览初始化失败",true);return;}
+ bool captureCompatible=options.settings.captureCompatible;
+ if(!preview.initialize(previewDesc)||!presenter.open(ctx,window,preview,captureCompatible)||!preview.createViews()){status(L"大图预览初始化失败",true);return;}
const auto freeFrame=[](AVFrame* p){av_frame_free(&p);};std::unique_ptr<AVFrame,decltype(freeFrame)> frame(av_frame_alloc(),freeFrame);
if(!frame){status(L"大图预览内存不足",true);return;}
frame->format=AV_PIX_FMT_RGBA;frame->width=width;frame->height=height;
@@ -36,6 +37,21 @@ void EngineController::runLargeImage(HWND window,const sink::RgbaImage& original
while(!stop_){
EnhancementSettings requested;std::wstring save;
{std::lock_guard lock(mutex_);requested=desired_;if(!enhanced.pixels.empty())save.swap(savePath_);}
+ if(requested.captureCompatible!=captureCompatible){
+ if(!ring.drainQueue()){status(L"显示切换排空失败",true);break;}
+ presenter.close();
+ if(!presenter.open(ctx,window,preview,requested.captureCompatible)){
+ presenter.close();
+ if(!presenter.open(ctx,window,preview,captureCompatible)){status(L"显示切换恢复失败",true);break;}
+ std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,applied);snapshot_.desired=desired_;snapshot_.rejectedRevision=requested.revision;snapshot_.backendWarning=L"直播兼容模式未能启用,已恢复";continue;
+ }
+ captureCompatible=requested.captureCompatible;
+ }
+ auto contentSettings=requested;contentSettings.captureCompatible=applied.captureCompatible;
+ if(!enhanced.pixels.empty()&&contentSettings.sameVideoConfiguration(applied)){
+ applied=requested;
+ std::lock_guard lock(mutex_);snapshot_.applied=applied;snapshot_.applying=desired_!=applied;
+ }
if(!save.empty()){
try {
auto ext=std::filesystem::path(save).extension().wstring();for(auto& c:ext)c=towlower(c);
@@ -48,7 +64,7 @@ void EngineController::runLargeImage(HWND window,const sink::RgbaImage& original
std::lock_guard lock(mutex_);snapshot_.applied=applied;snapshot_.applying=desired_!=applied;
}
if(requested.revision!=applied.revision){
- pipeline::EnhanceGraphDesc desc;desc.enableNr=requested.nr;desc.noFeatures=!requested.nr;
+ pipeline::EnhanceGraphDesc desc;desc.enableNr=requested.nr;desc.nrRuntime=requested.nrRuntime;desc.noFeatures=!requested.nr;
desc.model=requested.model;desc.residual=requested.residual;desc.protection=requested.protection;desc.settingsRevision=requested.revision;
desc.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();
sink::RgbaImage candidate;TiledImageProcessor::Stats stats;
diff --git a/src/engine/PresetStore.cpp b/src/engine/PresetStore.cpp
index dc15ceee..89885ec2 100644
--- a/src/engine/PresetStore.cpp
+++ b/src/engine/PresetStore.cpp
@@ -13,25 +13,27 @@ bool nameOk(const std::wstring& s){return !s.empty()&&s.size()<=48&&s.front()!=L
std::wstring trim(std::wstring s){auto a=s.find_first_not_of(L" \t\r\n");if(a==s.npos)return {};auto b=s.find_last_not_of(L" \t\r\n");return s.substr(a,b-a+1);}
}
std::string PresetStore::serialize()const{
- std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 8\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';
- for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<'\n';}return o.str();
+ std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 10\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';
+ for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<' '<<int(s.nrRuntime)<<' '<<s.captureCompatible<<'\n';}return o.str();
}
bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,std::wstring& def){
if(data.size()>65536)return false;std::istringstream in(data);in.imbue(std::locale::classic());std::string magic,d;int version=0;size_t count=0;
- if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>8)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;
+ if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>10)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;
for(size_t i=0;i<count;++i){UserPreset p;std::string n;int policy,flow,content,nr,sr;auto& s=p.settings;auto& m=s.model;auto& r=s.residual;
if(!(in>>std::quoted(n)>>m.intensity>>m.tone>>m.structure>>m.skin>>m.style>>m.autoMask>>m.uiCorrection>>r.total>>r.darken>>r.brighten>>r.color>>r.luminance>>nr>>sr>>s.multiplier>>policy>>flow>>content))return false;
if(version>=2){int enabled;if(!(in>>enabled>>s.protection.featherPixels)||enabled<0||enabled>1)return false;s.protection.enabled=enabled!=0;
for(auto& q:s.protection.regions)if(!(in>>q.left>>q.top>>q.right>>q.bottom))return false;}
if(version>=3&&!(in>>s.videoSrQuality))return false;
if(version>=4){int backend;if(!(in>>backend)||backend<0||backend>(version>=6&&version<=7?2:1))return false;
- // Before v8, 1 meant removed FRUC and 2 meant XeSS. New writes use v8.
+ // Before v8, 1 meant removed FRUC and 2 meant XeSS. New writes use v10.
s.frameGenerationBackend=version<8
?(backend==2?FrameGenerationBackend::XeSS:FrameGenerationBackend::Dlss)
:static_cast<FrameGenerationBackend>(backend);}
if(version>=5){uint32_t target;if(!(in>>target))return false;s.srTarget=static_cast<pipeline::SrTarget>(target);}
if(version>=6){int backend,half;if(!(in>>backend>>half)||half<0||half>1)return false;s.opticalFlowBackend=static_cast<OpticalFlowBackend>(backend);s.amdFlowHalfResolution=half!=0;}
if(version>=7){int sync;if(!(in>>sync>>s.audioOffsetMs))return false;s.audioSync=static_cast<AudioSyncMode>(sync);}
+ if(version>=9){int runtime;if(!(in>>runtime))return false;s.nrRuntime=static_cast<NrRuntime>(runtime);}
+ if(version>=10){int capture;if(!(in>>capture)||capture<0||capture>1)return false;s.captureCompatible=capture!=0;}
p.name=wide(n);if(!nameOk(p.name)||std::any_of(out.begin(),out.end(),[&](auto& a){return a.name==p.name;})||nr<0||nr>1||sr<0||sr>1)return false;
s.nr=nr;s.sr=sr;s.nrPolicy=static_cast<pipeline::NrSizePolicy>(policy);s.flow=static_cast<FlowQuality>(flow);s.content=static_cast<ContentRate>(content);
if(!s.validate().empty())return false;out.push_back(std::move(p));
diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cpp
index 7c59c3ba..d9794ec1 100644
--- a/src/engine/VideoExportJob.cpp
+++ b/src/engine/VideoExportJob.cpp
@@ -52,7 +52,7 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpti
const AVRational rate=av_mul_q({rateNum,rateDen},{int(options.fg?options.fgMultiplier:1),1});
veyra::log::info("export-timeline",std::format("CFR declared={}/{} candidate={}/{} timestampQuantum={} sampled={} output={}/{} (timestamp-consistent candidate, quantized short clips may be ambiguous; every PTS validated)",info.nominalRateNum,info.nominalRateDen,rateNum,rateDen,info.timestampQuantum,samples.size(),rate.num,rate.den));
const auto resolution=pipeline::ResolutionPlan::make({info.width,info.height},options.sr,pipeline::NrSizePolicy::Native,true,options.settings.revision,options.settings.srTarget);
- pipeline::EnhanceGraphDesc gd;gd.sourceWidth=info.width;gd.sourceHeight=info.height;gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.nrWidth=resolution.nr.width;gd.nrHeight=resolution.nr.height;gd.flowWidth=resolution.flow.width;gd.flowHeight=resolution.flow.height;gd.enableSr=resolution.srApplied;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.frameGenerationBackend=options.settings.frameGenerationBackend;gd.enableNvofStandalone=options.nr;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.opticalFlowBackend=options.settings.opticalFlowBackend;gd.amdFlowHalfResolution=options.settings.amdFlowHalfResolution;gd.contentRate=options.settings.content;gd.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();
+ pipeline::EnhanceGraphDesc gd;gd.sourceWidth=info.width;gd.sourceHeight=info.height;gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.nrWidth=resolution.nr.width;gd.nrHeight=resolution.nr.height;gd.flowWidth=resolution.flow.width;gd.flowHeight=resolution.flow.height;gd.enableSr=resolution.srApplied;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr;gd.nrRuntime=options.settings.nrRuntime;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.frameGenerationBackend=options.settings.frameGenerationBackend;gd.enableNvofStandalone=options.nr;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.opticalFlowBackend=options.settings.opticalFlowBackend;gd.amdFlowHalfResolution=options.settings.amdFlowHalfResolution;gd.contentRate=options.settings.content;gd.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();
if(!graph.initialize(gd)||!graph.createViews())break;
if(avformat_alloc_output_context2(&mux,nullptr,"mp4",utf8(partial).c_str())<0||!mux)break;
videoStream=avformat_new_stream(mux,nullptr);if(!videoStream)break;videoStream->time_base={rate.den,rate.num};videoStream->avg_frame_rate=rate;
diff --git a/src/engine/VideoPresenter.cpp b/src/engine/VideoPresenter.cpp
index 83cb1805..e1932f1b 100644
--- a/src/engine/VideoPresenter.cpp
+++ b/src/engine/VideoPresenter.cpp
@@ -4,10 +4,10 @@
#include "veyra/gfx/CommandSlotRing.h"
#include "veyra/sink/ImageExportSink.h"
namespace veyra::engine {
-bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::EnhanceGraph& graph) {
+bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::EnhanceGraph& graph,bool captureCompatible) {
gpuTimer_.initialize(ctx.device(),ctx.directQueue());window_=window;RECT rc{};GetClientRect(window,&rc);
gfx::PresentSink::Desc d;d.targetWindow=window;d.width=std::max(1L,rc.right);d.height=std::max(1L,rc.bottom);d.vsync=false;
- d.xess=graph.xessEnabled();lastXessFrame_={};lastXessIdentity_={};xessWasEnabled_=false;
+ d.xess=graph.xessEnabled();d.captureCompatible=captureCompatible;lastXessFrame_={};lastXessIdentity_={};xessWasEnabled_=false;
Status st=Status::Ok;if(!sink_.initialize(ctx.device(),ctx.directQueue(),d,st))return false;
std::vector<uint8_t> vs,ps;
if(!pipeline::loadShaderBytes("PresentBlit_vs.dxil",vs)||!pipeline::loadShaderBytes("PresentBlit_ps.dxil",ps)||!pass_.create(ctx.device(),vs,ps,12))return false;
diff --git a/src/gfx/PresentSink.cpp b/src/gfx/PresentSink.cpp
index 5b1a75ef..3cbf5add 100644
--- a/src/gfx/PresentSink.cpp
+++ b/src/gfx/PresentSink.cpp
@@ -14,6 +14,7 @@ namespace {
const wchar_t* kWindowClassName = L"VeyraPresentSink";
+
} // namespace
PresentSink::~PresentSink()
@@ -103,7 +104,9 @@ bool PresentSink::initialize(ID3D12Device* device, ID3D12CommandQueue* queue,
scd.SampleDesc.Count = 1;
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
scd.BufferCount = 3;
- scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
+ // Opt-in capture experiment; actual capture support depends on the
+ // external capture API. Neither mode changes the pixel format.
+ scd.SwapEffect = desc.captureCompatible ? DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL : DXGI_SWAP_EFFECT_FLIP_DISCARD;
scd.Flags = tearingSupported_ ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0;
ComPtr<IDXGISwapChain1> swapChain1;
@@ -143,8 +146,14 @@ bool PresentSink::initialize(ID3D12Device* device, ID3D12CommandQueue* queue,
bufferExtentW_ = width_;
bufferExtentH_ = height_;
- log::info("present", std::format("present-sink: window {}x{} flip-discard buffers=3 vsync={} tearing={}",
- width_, height_, desc_.vsync ? 1 : 0, tearingSupported_ ? 1 : 0));
+ DXGI_SWAP_CHAIN_DESC1 actual{};
+ const HRESULT descResult=swapChain_->GetDesc1(&actual);
+ if(FAILED(descResult)||actual.SwapEffect!=scd.SwapEffect){
+ log::error("present",std::format("swapchain mode rejected hr=0x{:X} requested={} actual={}",unsigned(descResult),unsigned(scd.SwapEffect),unsigned(actual.SwapEffect)));
+ status=Status::WindowFailure;return false;
+ }
+ log::info("present", std::format("present-sink: window {}x{} swapEffect={} buffers=3 vsync={} tearing={} captureCompatible={} (capture not verified)",
+ width_, height_, desc.captureCompatible?"flip-sequential":"flip-discard", desc_.vsync ? 1 : 0, tearingSupported_ ? 1 : 0, desc.captureCompatible));
return true;
}
diff --git a/src/ngx/DlssNrRuntimeAdapter.cpp b/src/ngx/DlssNrRuntimeAdapter.cpp
index b486a054..de25eceb 100644
--- a/src/ngx/DlssNrRuntimeAdapter.cpp
+++ b/src/ngx/DlssNrRuntimeAdapter.cpp
@@ -332,7 +332,7 @@ bool DlssNrRuntimeAdapter::load(const std::wstring& runtimeDir, Status& status)
// Development staging and the explicitly named experimental Release pack.
const auto allowed=[&](const wchar_t* suffix){const size_t n=wcslen(suffix);return dllPath_.size()>n&&_wcsicmp(dllPath_.c_str()+dllPath_.size()-n,suffix)==0;};
- if (!allowed(L"\\runtime_local\\nvidia\\nvngx_dlssnr.dll")&&!allowed(L"\\runtime\\experimental\\nvngx_dlssnr.dll")) {
+ if (!allowed(L"\\runtime_local\\nvidia\\nvngx_dlssnr.dll")&&!allowed(L"\\runtime\\experimental\\nvngx_dlssnr.dll")&&!allowed(L"\\runtime_local\\nvidia\\nr-community\\nvngx_dlssnr.dll")&&!allowed(L"\\runtime\\experimental\\nr-community\\nvngx_dlssnr.dll")) {
status = Status::InvalidArgument;
veyra::log::error("ngx", "nr-adapter: resolved runtime path is outside approved staging/experimental directory; refusing to load");
return false;
diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cpp
index 7d159791..ba210596 100644
--- a/src/pipeline/EnhanceGraph.cpp
+++ b/src/pipeline/EnhanceGraph.cpp
@@ -380,10 +380,13 @@ bool EnhanceGraph::initNgxFeatures()
}
if(nrEnabled_){
+ if(desc_.nrRuntime!=engine::NrRuntime::Original&&desc_.nrRuntime!=engine::NrRuntime::Community)return false;
+ auto nrDirectory=std::filesystem::path(desc_.runtimeAbsPath);if(desc_.nrRuntime==engine::NrRuntime::Community)nrDirectory/=L"nr-community";
+ veyra::log::info("nr-runtime",std::format("selected={} path={}",engine::nrRuntimeName(desc_.nrRuntime),nrDirectory.string()));
nrAdapter_ = std::make_unique<ngx::DlssNrRuntimeAdapter>();
- if (!nrAdapter_->load(desc_.runtimeAbsPath.c_str(), st) ||
+ if (!nrAdapter_->load(nrDirectory.wstring(), st) ||
!nrAdapter_->installCallerCompatibility(st) ||
- !nrAdapter_->snippetInitExt(context_.device(), desc_.runtimeAbsPath.c_str(), nrResult_, nrSeh_) ||
+ !nrAdapter_->snippetInitExt(context_.device(), nrDirectory.c_str(), nrResult_, nrSeh_) ||
nrResult_ != static_cast<uint64_t>(NVSDK_NGX_Result_Success)) {
veyra::log::error("graph", std::format("NR snippet init failed 0x{:X}", nrResult_));
return false;
@@ -1221,7 +1224,7 @@ bool EnhanceGraph::applySettings(const engine::EnhancementSettings& s){
// DLSS allocates multiplier-specific feature/output resources.
// XeSS has a fixed 2X proxy swapchain contract. Settings callers must
// rebuild instead of accepting a change that cannot take effect in place.
- if(std::max(2u,s.multiplier)!=desc_.fgMultiplier||s.frameGenerationBackend!=desc_.frameGenerationBackend||s.videoSrQuality!=desc_.videoSrQuality||!s.validate().empty()||(s.multiplier>1&&s.frameGenerationBackend!=engine::FrameGenerationBackend::XeSS&&(!fgCapsAvailable_||s.multiplier-1>uint32_t(fgMultiFrameMax_))))return false;
+ if(s.nrRuntime!=desc_.nrRuntime||std::max(2u,s.multiplier)!=desc_.fgMultiplier||s.frameGenerationBackend!=desc_.frameGenerationBackend||s.videoSrQuality!=desc_.videoSrQuality||!s.validate().empty()||(s.multiplier>1&&s.frameGenerationBackend!=engine::FrameGenerationBackend::XeSS&&(!fgCapsAvailable_||s.multiplier-1>uint32_t(fgMultiFrameMax_))))return false;
desc_.contentRate=s.content;desc_.model=s.model;desc_.residual=s.residual;desc_.protection=s.protection;desc_.settingsRevision=s.revision;
desc_.fgMultiplier=std::max(2u,s.multiplier);desc_.enableNvofStandalone=s.nr&&!desc_.stillImage;nvofStandalone_=desc_.enableNvofStandalone;
setNrEnabled(s.nr);setFgEnabled(s.multiplier>1&&s.frameGenerationBackend!=engine::FrameGenerationBackend::XeSS);
diff --git a/tests/unit/RepairPresetTests.cpp b/tests/unit/RepairPresetTests.cpp
index 865eb52f..8596ba04 100644
--- a/tests/unit/RepairPresetTests.cpp
+++ b/tests/unit/RepairPresetTests.cpp
@@ -6,7 +6,7 @@ namespace {
bool legacyBackends(const std::filesystem::path& path) {
using namespace veyra::engine;
unsigned checks=0;
- for(int version=4;version<=8;++version)for(int backend=0;backend<=2;++backend)for(int multiplier:{2,4}){
+ for(int version=4;version<=10;++version)for(int backend=0;backend<=2;++backend)for(int multiplier:{2,4}){
std::ostringstream fixture;
fixture<<"VEYRA_PRESETS "<<version<<"\n\"legacy\" 1\n\"legacy\" 1 1 1 -1 0 0 0 1 1 1 1 1 1 0 "<<multiplier<<" 0 1 0";
fixture<<" 0 0";
@@ -15,6 +15,8 @@ bool legacyBackends(const std::filesystem::path& path) {
if(version>=5)fixture<<" 1";
if(version>=6)fixture<<" 0 0";
if(version>=7)fixture<<" 1 137";
+ if(version>=9)fixture<<" 1";
+ if(version>=10)fixture<<" 1";
fixture<<'\n';
{std::ofstream file(path);file<<fixture.str();}
const bool xess=version<8?backend==2:backend==1;
@@ -24,11 +26,13 @@ bool legacyBackends(const std::filesystem::path& path) {
if(store.load()!=expected)return false;
if(expected){
const auto value=store.defaultSettings();
+ if(value.captureCompatible!=(version>=10))return false;
+ if(value.nrRuntime!=(version>=9?NrRuntime::Community:NrRuntime::Original))return false;
if(value.frameGenerationBackend!=(xess?FrameGenerationBackend::XeSS:FrameGenerationBackend::Dlss)||value.multiplier!=multiplier||value.videoSrQuality!=2)return false;
if(version>=7&&(value.audioSync!=AudioSyncMode::Manual||value.audioOffsetMs!=137))return false;
if(!store.put(L"legacy",value,true))return false;
std::ifstream file(path);std::string magic;int savedVersion=0;file>>magic>>savedVersion;
- if(magic!="VEYRA_PRESETS"||savedVersion!=8)return false;
+ if(magic!="VEYRA_PRESETS"||savedVersion!=10)return false;
PresetStore reloaded(path);
if(!reloaded.load()||reloaded.defaultSettings()!=value)return false;
}else{
@@ -45,12 +49,14 @@ bool legacyBackends(const std::filesystem::path& path) {
int main(int argc,char** argv){if(argc!=2)return 2;using namespace veyra::engine;const std::filesystem::path p=argv[1];PresetStore a(p);bool ok=a.load();EnhancementSettings s;s.videoSrQuality=2;s.frameGenerationBackend=FrameGenerationBackend::Dlss;s.opticalFlowBackend=OpticalFlowBackend::AmdFidelityFx;s.amdFlowHalfResolution=true;s.protection.enabled=true;s.protection.featherPixels=3.5f;s.protection.regions[0]={.1f,.2f,.7f,.8f};s.protection.regions[3]={0,0,1,1};s.model.intensity=.375f;s.model.skin=1.5f;s.residual.darken=1.2f;s.multiplier=4;s.flow=FlowQuality::Quality;s.content=ContentRate::Fps50;s.nrPolicy=veyra::pipeline::NrSizePolicy::Native;
s.srTarget=veyra::pipeline::SrTarget::Uhd8K;
s.audioSync=AudioSyncMode::Manual;s.audioOffsetMs=137;
+ s.nrRuntime=NrRuntime::Community;s.captureCompatible=true;
ok=ok&&a.put(L"test",s)&&a.setDefault(0)&&!a.put(L"test",s);PresetStore b(p);ok=ok&&b.load()&&b.defaultSettings()==s&&b.rename(0,L"renamed")&&b.defaultSettings()==s;
auto badTarget=s;badTarget.srTarget=static_cast<veyra::pipeline::SrTarget>(3);ok=ok&&!b.put(L"invalid target",badTarget);
auto xess=s;xess.frameGenerationBackend=FrameGenerationBackend::XeSS;ok=ok&&!b.put(L"XeSS 4X rejected",xess);
xess.multiplier=2;ok=ok&&b.put(L"XeSS 2X",xess);PresetStore xessReload(p);ok=ok&&xessReload.load()&&xessReload.entries().back().settings==xess&&b.erase(1);
auto badBackend=s;badBackend.frameGenerationBackend=static_cast<FrameGenerationBackend>(3);ok=ok&&!b.put(L"invalid backend",badBackend);
auto badFlow=s;badFlow.opticalFlowBackend=static_cast<OpticalFlowBackend>(2);ok=ok&&!b.put(L"invalid flow backend",badFlow);
+ auto badNr=s;badNr.nrRuntime=static_cast<NrRuntime>(2);ok=ok&&!b.put(L"invalid NR runtime",badNr);
auto half=s;half.content=ContentRate::Capture60To30;ok=ok&&b.put(L"capture half rate",half);PresetStore halfReload(p);ok=ok&&halfReload.load()&&halfReload.entries().back().settings.content==ContentRate::Capture60To30&&b.erase(1);
auto badSr=s;badSr.videoSrQuality=5;ok=ok&&!b.put(L"invalid video SR",badSr);
auto invalid=s;invalid.model.tone=9;ok=ok&&!b.put(L"bad",invalid)&&b.entries().size()==1&&b.erase(0)&&b.entries().empty();