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

Integrate NR reuse with volume, HDR and DLAA fixes

Veyra Goal Agent77d6c09066f1
diff --cc docs/WORKLOG.md
index 847ca911,90b9c1c1..f48c06c0
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@@ -799,26 -799,59 +799,83 @@@ Veyra-2.1.3-AMD-win64-portable.zip:71
删除122372文件,逻辑53.72 GiB,E盘实测可用净增33.73 GiB;项目路径累计152.89→99.28 GiB。34关键文件/正式与源码ZIP SHA不变,19工作树原HEAD/修改清单不变,依赖/Junction/用户配置/当前build与app保留。只清编译中间文件、旧测试部署与未发布包、私有缓存、旧性能读回;保留修改与用户数据候选315项,首次预检20个Profile命名obj保守排除。单文件1.4.0旧下载ZIP删除被自动审批blocked by policy拒绝,未执行、未绕过,仍保留。详情docs/PROJECT_CLEANUP_2026-11-06.md和reports/codex-project-cleanup-20261106/FINAL.json,命令及逐文件证据在同任务。产品代码/正式包不改,未push/发布。
+ ## 2026-11-07 NR 推理复用(自动推理复用,Claude,未提交)
+
+ **来由**:用户不复制、不移植 SAOG0721/Magpie 代码,选了自研方案 A,要求开关名为“自动推理复用”,另提供手动 1/2、1/3、1/4。
+
+ - 分支 `claude/nr-reuse-20261107`,基于 main 0079ed9;
+ - 工作树 `worktrees/claude-nr-reuse-20261107`,构建目录 `build/claude-nr-reuse-20261107`;
+ - 没有动共用施工树和当前可用构建。
+
+ **行为**:
+
+ - 只用于实时预览。复用帧不跑 NR,输出“本帧源 + 上一推理帧的 NR 变化”,变化按光流搬运。
+ - 变化拆成两部分:邻域均值按 3×3 邻域是否匹配决定是否搬;细节只在本像素细节也一致时才搬。对不上、出界或在保护区内时显示原图。
+ - 复用帧之后一定重新推理。那一帧给 NR 和时域稳定器的运动换成串接后的运动。
+ - 手动 1/2、1/3、1/4 表示每 2/3/4 帧复用 1 帧。
+ - 自动由 AutoNrReuseController 选档:平均增强耗时对比 80% 帧间隔,超预算 0.5 秒升档;预测降档仍低于 0.85 倍预算并持续 3 秒才降档;最多每 2 帧复用 1 帧。
+ - 开关切换会重建图,档位之间实时切换。
+ - 暂停时若最后一帧是复用帧,补做一次完整推理重绘。
+ - 导出、图片、预热图、最近图缓存、COMPUTE 准入和自动 NR 尺寸池都不收复用配置。
+
+ **验证**:
+
+ - 新单测 33/0,新 GPU 测试 7/0(调试层 0);
+ - QtQuick 172/0/1;
+ - 设置、预设、合同、翻译、抗闪烁、稳定器 GPU 回归通过;设置事务和 AMD 合成图 128/0 在运行目录内通过。
+ - 真实程序:
+ - 1 层 4K60,1/2 时平均增强耗时 4.49 → 3.11 ms;
+ - 4 层超载,自动约 2 秒升到每 4 帧复用 1 帧,15.24 → 11.64 ms,跳帧停止;
+ - 实时切档和暂停重绘通过。
+ - 画质(对比每帧推理):720p 真实平移,复用帧平均差 0.70/255、PSNR 45.7 dB;合成测试卡上差异集中在随机噪点块和移动细线。
+
+ **记录**:`docs/NR_INFERENCE_REUSE_2026-11-07.md`,回执 `E:/项目/Veyra/reports/claude-nr-reuse-20261107/FINAL.json`。手动入口 `tests/claude-nr-reuse-20261107/启动推理复用测试.cmd`,独立配置。
+
+ **范围**:未打包、未提交、未合 main、未 push。只在本机 RTX 5070 验证,其他显卡、HDR、节点模式、采集卡未验证。
+
+ ## 2026-11-07 NR 推理复用界面调整、提交 fps 的 1% low、色温冷端修正(Claude,未提交)
+
+ 同一工作树 `worktrees/claude-nr-reuse-20261107`,按用户截图反馈修改:
+
+ - **NR 推理复用**:
+ - 去掉“已复用 N 帧”;
+ - 卡片改名“NR 自动推理复用”;
+ - “输出稳定器 · 抗闪烁”“NR 自动推理复用”“NR 全局保护区域”挪进“NR 画面增强”,与 NR 层并列;
+ - 复用帧给 NR 阶段记零长度计时样本,底部阶段耗时的平均随复用实时下降(4 层 4K60:NR 第4层 3.50 → 1.77 ms,总 16.24 → 8.36 ms),P95 仍是单次推理;自动档改用 P95 估算单次推理成本。
+ - **图标**:两张卡的 `shield` 图标原本不在图标库,一直空白,已补 Lucide shield 并重新生成 IconData。
+ - **帧率卡**:“显示 fps”从未接入测量、永远未测,已删除。RTSS 也是按 Present 计帧,等同于提交 fps。
+ - 现在提交 fps 是主数字,旁边显示 1% low,算法为最近 10 秒 Present 间隔的第 99 百分位;三处界面统一;
+ - 实测“60.0 提交 fps | 39.5 1% low”。
+ - **色温**:普朗克曲线 2222–4000 K 段 y 常数项写错(−0.0317,应为 −0.1675),−100 时蓝通道 ×23、在约 −70 处突跳。已修正,并把冷端按迈尔德与暖端镜像(−100 = 4333 K),暖端不变;真实画面 −100 偏冷但不爆。
+
+ **验证**:
+ - 新单测:NR 复用 33/0、播放计时 164(含 1% low 5 项)、色彩表 54(含色温 3 项);
+ - 色彩 GPU 通过,slot 回归在运行目录内 12/12,QtQuick 172/0/1,翻译 0 缺失。
+
+ **记录**:`docs/NR_INFERENCE_REUSE_2026-11-07.md`、`docs/FPS_LOW1_AND_COLOR_TEMPERATURE_2026-11-07.md`,回执 `E:/项目/Veyra/reports/claude-nr-reuse-20261107/FINAL.json`。
+
+ **范围**:未提交、未合 main、未 push;只在本机 RTX 5070 验证,没有与 RTSS 读数逐帧对照。
++
+
+## 2026-11-08 接手Claude:音量记忆与全后端双重超分
+
+读取Claude最新会话9720f799,原任务为“音量每次回100%”“其他超分也支持双重”。独立树worktrees/claude-volume-dual-sr-20261108,分支claude/volume-dual-sr-20261108,基线0079ed9;原20文件逐SHA核对未改字节,保存产品提交356013b。音量500ms防抖及退出保存;双重SR扩展DLSS/FSR,两个独立时域实例/历史、运动坐标、生命周期和内存估算,UI两模式共用并支持混合算法,新格式与旁文件保护旧设置。
+
+Claude初次构建305.9s,原完整Quick172/0/1、25 GPU用例、原双重/超采样、真实UI、设置事务及导出通过;本机RTX5070。Codex补真实程序音量23%立刻退出/重启/越界值,保持编译缓存;设置274/0、效果链和预设库通过;给单个跳过的栅格测试显式目录后成功保存6图。六组既有NVENC导出重新比对360帧,错位0,不冒充画质全面验收。原启动器cmd引号/控制字符/工作目录问题已修并实际运行、独立配置、定时退出通过。未改用户配置/其他进程/运行库或驱动。
+
+最终命令build-recording-handoff.py --task claude-volume-dual-sr-20261108 --root E:/项目/Veyra/worktrees/claude-volume-dual-sr-20261108 --label 2.1.3-volume-dual-sr-test --jobs 2,12目标,干净产品提交增量1.0s通过;完整目标及receipt见docs/VOLUME_DUAL_SR_2026-11-08.md和logs同任务/build-20261108-023124。EXE91b93b45…与既有验收字节相同,未因文档变化盲目重测全套。
+
+独立命令:python -X utf8 -B E:/项目/Veyra/reports/claude-volume-dual-sr-20261108/codex_verify.py --remaining;full_align.py 对六个tests同任务/out/*.mp4与源pan720p-16s.mp4比较。首个设置测试误先建scratch触发exit2,改为不存在路径后274/0;之前失败日志保留。Claude旧RTX-only断言、默认档位和错误尺寸测试输入的修正也保留记录。
+
+报告reports/claude-volume-dual-sr-20261108/FINAL.json;手动入口tests同任务/启动音量与双重超分测试.cmd,manual-profile独立;docs/VOLUME_DUAL_SR_2026-11-08.md说明限制。只保留任务现有可用stage/build/证据,未多做重复整包。本轮未合main、未push/Release;NR推理复用独立分支保持原状态,无AMD实卡验收,不重跑历史8K+NR+VFG卡死组合。
+
+
+## 2026-11-08 录制、HDR超分、DLAA交接与11条审查修复
+
+工作树 `E:/项目/Veyra/worktrees/claude-record-hdr-dlaa-20261108`,分支 `claude/record-hdr-dlaa-20261108`,基线 `84e2cb5`。Claude主体完成后接手,原23文件SHA快照在任务报告目录。最新用户追加要求修复Claude审查的11条。原始审查与处理逐项见 `reports/claude-record-hdr-dlaa-20261108/CLAUDE-REVIEW.json` 和 `AUDIT-RESOLUTION.json`,细节见 `docs/RECORD_HDR_DLAA_2026-11-08.md`。
+
+构建 `python -X utf8 -B scripts/acceptance/build-recording-handoff.py --task claude-record-hdr-dlaa-20261108 --root E:/项目/Veyra/worktrees/claude-record-hdr-dlaa-20261108 --label 2.1.3-record-hdr-dlaa-test --jobs 2 veyra_qml_ui veyra_anti_alias_gpu_tests veyra_preset_library_tests veyra_effect_chain_tests veyra_video_ai_settings_tests veyra_ui_contract_tests veyra_settings_transaction_tests veyra_qml_quick_tests veyra_ui_i18n_tests veyra_sr_quality_tests`。初次Codex构建118.3s,审查后增量72.3s。主程序 `52a86650…`,同任务build和app,不制作额外发布包。
+
+验收运行 `python -X utf8 -B E:/项目/Veyra/reports/claude-record-hdr-dlaa-20261108/audit_checks.py` 与 `quick_run.py suite-audit`。30次调用通过,QtQuick175/0/0,设置274/0,设置事务D3D12错误0,1440p DLAA 3个历史帧获得光流,DLSS/FSR HDR色块通过,8组HDR双重超分通过。先前合并运行SDR后超时,分算法对重跑并独立执行事务检查。预设同TEMP两次通过。真实F8开停各记录Qt Quick实际事件,进出全屏无额外录制请求,431帧及文件完整性核对通过。现场旧日志不含触发源,AMD实卡和采集卡现场未验。
+
+独立配置入口 `E:/项目/Veyra/tests/claude-record-hdr-dlaa-20261108/启动录制HDR与DLAA测试.cmd`。新增约9.1 MB录制证据及测试日志,复用单份当前测试程序。已核验旧app213重复副本1,079,122,186字节,自动审批blocked by policy拒绝删除,未绕过。最终回执同任务FINAL.json。未合main、未推送、未发布。用户要求汇报后正常关机。
diff --cc src/pipeline/EnhanceGraph.cpp
index 199e1c1d,833101ea..c0204e67
--- a/src/pipeline/EnhanceGraph.cpp
+++ b/src/pipeline/EnhanceGraph.cpp
@@@ -450,30 -436,6 +450,32 @@@ bool EnhanceGraph::createNodeColorResou
}
bool EnhanceGraph::createAntiAlias(uint32_t parameter,uint32_t width,uint32_t height){
+ if(desc_.antiAlias[parameter].usesDlaa()){
+ // DLAA: the output and constant zero motion / depth at this size; the DLSS
+ // feature is created with the NGX features (initNgxFeatures).
+ auto& d=dlaa_[parameter];d={};d.width=width;d.height=height;
+ antiAliasOutputs_[parameter]=makeTexture(context_.device(),width,height,DXGI_FORMAT_R16G16B16A16_FLOAT,true);
+ // DLSS is temporal and NVIDIA RTX only: a still image or another adapter
+ // passes the picture through, and the status says why.
+ const wchar_t* why=desc_.stillImage?L"图片不支持 DLAA":!context_.adapter().isNvidia?L"需要 NVIDIA RTX 显卡":
+ (desc_.noFeatures||desc_.noNgx)?L"增强功能已关闭":nullptr;
+ if(why){d.copy=true;antiAliasNotice_+=std::format(L"抗锯齿实例 {} DLAA 未运行({}),画面原样通过。",parameter+1,why);}
+ bool created=antiAliasOutputs_[parameter]!=nullptr;
+ if(created&&!d.copy){
+ d.zeroMotion=makeTexture(context_.device(),width,height,DXGI_FORMAT_R16G16_FLOAT,false);
+ d.depth=makeTexture(context_.device(),width,height,DXGI_FORMAT_R32_FLOAT,false);
++ // NR reuse may replace nrFlow_ with motion spanning two source frames.
++ // DLAA always consumes motion from this frame to its immediate predecessor.
+ const bool sharedMotion=(width==nvofW_&&height==nvofH_)||
- (baseFlow_&&width==workW_&&height==workH_)||(nrFlow_&&width==nrW_&&height==nrH_);
++ (baseFlow_&&width==workW_&&height==workH_);
+ if(!sharedMotion)d.adaptedMotion=makeTexture(context_.device(),width,height,DXGI_FORMAT_R16G16_FLOAT,true);
+ created=d.zeroMotion&&d.depth&&(sharedMotion||d.adaptedMotion)&&
+ (!desc_.hdrWorking()||createSignedHdrRestore(d.hdr,width,height));
+ }
+ veyra::log::info("anti-alias",std::format("instance={} DLAA extent={}x{} hdr={} mode={}{}",parameter,width,height,desc_.hdrWorking(),
+ d.copy?"copy":"dlss",created?"":" (texture creation failed)"));
+ return created;
+ }
auto& pass=antiAliasPasses_[parameter];
pass=std::make_unique<AntiAliasPass>();
antiAliasOutputs_[parameter]=makeTexture(context_.device(),width,height,DXGI_FORMAT_R16G16B16A16_FLOAT,true);
@@@ -483,93 -445,6 +485,92 @@@
return created;
}
+bool EnhanceGraph::dlaaRequested() const {
+ return std::any_of(dlaa_.begin(),dlaa_.end(),[](const DlaaInstance& d){return d.width&&!d.copy;});
+}
+bool EnhanceGraph::sourcePostAfterFlow() const {
+ return std::any_of(sourcePostPasses_.begin(),sourcePostPasses_.end(),[this](const SlotPass& p){
+ return p.type==engine::EffectType::AntiAliasing&&dlaa_[p.parameter].width&&!dlaa_[p.parameter].copy;});
+}
+uint64_t EnhanceGraph::dlaaEvaluateCount() const {
+ uint64_t n=0;for(const auto& d:dlaa_)n+=d.evaluations;return n;
+}
+uint64_t EnhanceGraph::dlaaMotionEvaluateCount() const {
+ uint64_t n=0;
+ for(const auto& d:dlaa_)n+=d.evaluations-std::min(d.evaluations,d.motionless);
+ return n;
+}
+bool EnhanceGraph::createSignedHdrRestore(SignedHdrRestore& restore,uint32_t width,uint32_t height){
+ std::vector<uint8_t> shader;
+ restore.raw=makeTexture(context_.device(),width,height,DXGI_FORMAT_R16G16B16A16_FLOAT,true);
+ return restore.raw&&restore.pass.loadShader("DlaaHdrRestore.dxil",shader)&&
+ restore.pass.create(context_.device(),shader,3,2,1);
+}
+void EnhanceGraph::bindSignedHdrRestore(SignedHdrRestore& restore,ID3D12Resource* input,ID3D12Resource* output){
+ if(!restore.raw)return;
+ stager_.stageSrv(input,nullptr,restore.pass.heap.Get(),0);
+ stager_.stageSrv(restore.raw.Get(),nullptr,restore.pass.heap.Get(),1);
+ makeUav(context_.device(),output,DXGI_FORMAT_R16G16B16A16_FLOAT,cpuHandleOf(restore.pass,2));
+}
+void EnhanceGraph::finishTemporalOutput(ID3D12GraphicsCommandList* list,SignedHdrRestore& restore,ID3D12Resource* output){
+ if(restore.raw){
+ tracker_.uavBarrier(list,restore.raw.Get());
+ tracker_.transition(list,restore.raw.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ tracker_.transition(list,output,D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ const float constants[8]{};
+ restore.pass.bind(list,constants,gpuHandleOf(restore.pass,0).ptr,gpuHandleOf(restore.pass,2).ptr);
+ const auto extent=output->GetDesc();
+ list->Dispatch((UINT(extent.Width)+15)/16,(extent.Height+15)/16,1);
+ }
+ tracker_.uavBarrier(list,output);
+ tracker_.transition(list,output,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+}
+// One DLAA instance: DLSS at the instance's size, or a copy where it cannot run.
+// Motion is this frame's flow field of the same size (the optical flow itself, or
+// its adaptation to the work / NR size); without one the frame is evaluated with
+// zero motion and a reset, so no earlier frame is blended in at a wrong place.
+bool EnhanceGraph::dispatchDlaa(ID3D12GraphicsCommandList* list,const SlotPass& pass,bool reset){
+ auto& d=dlaa_[pass.parameter];
+ if(!d.input||!pass.output)return false;
+ if(d.copy||!d.backend||!d.backend->created()){
+ tracker_.transition(list,d.input,D3D12_RESOURCE_STATE_COPY_SOURCE);
+ tracker_.transition(list,pass.output,D3D12_RESOURCE_STATE_COPY_DEST);
+ list->CopyResource(pass.output,d.input);
+ tracker_.transition(list,d.input,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ tracker_.transition(list,pass.output,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ return true;
+ }
+ ID3D12Resource* motion=nullptr;const char* field="none";
+ if(frameFlowValid_){
+ if(flowTex_&&d.width==nvofW_&&d.height==nvofH_){motion=flowTex_.Get();field="optical flow";}
+ else if(baseFlow_&&d.width==workW_&&d.height==workH_){motion=baseFlow_.Get();field="work-size flow";}
- else if(nrFlow_&&d.width==nrW_&&d.height==nrH_){motion=nrFlow_.Get();field="NR-size flow";}
+ else if(d.adaptedMotion){motion=d.adaptedMotion.Get();field="DLAA-size flow";}
+ }
+ const bool motionValid=motion!=nullptr;
+ if(!motionValid){motion=d.zeroMotion.Get();++d.motionless;}
+ if(!d.motionLogged&&frameFlowValid_){
+ d.motionLogged=true;
+ veyra::log::info("anti-alias",std::format("instance={} DLAA motion={} extent={}x{} flow={}x{}",pass.parameter,field,d.width,d.height,nvofW_,nvofH_));
+ }
+ tracker_.transition(list,d.input,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ tracker_.transition(list,motion,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ tracker_.transition(list,d.depth.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ auto* target=d.hdr.raw?d.hdr.raw.Get():pass.output;
+ tracker_.transition(list,target,D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ ngx::DlssSrBackend::EvalDesc ed{};
+ ed.color=d.input;ed.output=target;ed.depth=d.depth.Get();ed.motionVectors=motion;
+ ed.reset=reset||!motionValid;
+ Status st=Status::Ok;
+ if(!d.backend->evaluate(list,ngxParams_,ed,st)){
+ failedBackend_=engine::FailedBackend::Dlaa;
+ veyra::log::error("anti-alias",std::format("instance={} DLAA evaluate failed",pass.parameter));
+ return false;
+ }
+ ++d.evaluations;
+ finishTemporalOutput(list,d.hdr,pass.output);
+ return true;
+}
+
bool EnhanceGraph::createBeauty(uint32_t parameter,uint32_t width,uint32_t height){
auto& pass=beautyPasses_[parameter];
pass=std::make_unique<BeautyPass>();
@@@ -828,20 -677,12 +829,25 @@@ bool EnhanceGraph::initialize(const Enh
const bool vfxFirst=srEnabled_&&vfxFirstSrPass(desc_);
const uint64_t vfxSrBytes=(vfxFinal?uint64_t(srInW_)*srInH_*4u+uint64_t(srOutW_)*srOutH_*4u:0)+
(vfxFirst?uint64_t(srcW_)*srcH_*4u+uint64_t(desc_.firstSrWidth)*desc_.firstSrHeight*4u:0);
+ // A bypass still needs its output, but owns neither guidance nor a model.
+ unsigned dlaaInstances=0, dlaaCopies=0;
+ const bool canRunDlaa=context_.adapter().isNvidia&&!desc_.stillImage&&!desc_.noFeatures&&!desc_.noNgx;
+ for(const auto& aa:desc_.antiAlias){
+ if(!aa.enabled||!aa.usesDlaa())continue;
+ if(canRunDlaa)++dlaaInstances;else ++dlaaCopies;
+ }
+ const uint64_t dlaaPixels=uint64_t(std::max(workW_,srcW_))*std::max(workH_,srcH_);
+ // Output, depth, zero/optional adapted motion, and raw HDR output.
+ const uint64_t dlaaBytes=dlaaPixels*(dlaaCopies*8u+dlaaInstances*(desc_.hdrWorking()?28u:20u));
+ const uint64_t temporalHdrBytes=desc_.hdrWorking()&&srEnabled_?
+ (temporalSrQuality(desc_.finalSrQuality())?uint64_t(workW_)*workH_*8u:0)+
+ ((desc_.firstSrRuns(0)||desc_.firstSrRuns(engine::kVideoSrFsr))?uint64_t(desc_.firstSrWidth)*desc_.firstSrHeight*8u:0):0;
- const uint64_t estimate=temporalHdrBytes+dlaaBytes+vfxSrBytes+dualBytes+supersampleBytes+uint64_t(workW_)*workH_*(76u+4u*generatedTextures)+vfgSharedBytes
+ // NR inference reuse keeps one inferred chain output and input plus motion
+ // at the flow extent (createNrReusePass); only a preview graph asks for it.
+ const bool reuseRequested=desc_.nrReusePreview&&desc_.enableNr&&desc_.nrReuse!=engine::NrReuseMode::Off;
+ const uint64_t reuseBytes=reuseRequested?uint64_t(desc_.finalNrAfterSr()?workW_:srcW_)*(desc_.finalNrAfterSr()?workH_:srcH_)*16u+
+ uint64_t(nvofW_)*nvofH_*20u:0;
- const uint64_t estimate=reuseBytes+vfxSrBytes+dualBytes+supersampleBytes+uint64_t(workW_)*workH_*(76u+4u*generatedTextures)+vfgSharedBytes
++ const uint64_t estimate=reuseBytes+temporalHdrBytes+dlaaBytes+vfxSrBytes+dualBytes+supersampleBytes+uint64_t(workW_)*workH_*(76u+4u*generatedTextures)+vfgSharedBytes
+nrTextureBytes+fullLayerBytes
+uint64_t(srcW_)*srcH_*(32u+(desc_.protectionBeforeSr()?8u:0u))+temporalBytes+tailColorBytes+interProtectionBytes
+(flowRefine_?uint64_t(nvofW_)*nvofH_*(flowConsistency_?13u:flowClaims_?18u:12u)+uint64_t(workW_)*workH_*4u:0);
@@@ -3180,16 -2962,24 +3251,34 @@@ bool EnhanceGraph::process(const AVFram
if(layer->motion()!=nrFlow_.Get())adapt(layer->motion(),layer->width(),layer->height(),3+UINT(i));
}
}
+ frameFlowValid_=haveFlow;
+ // A source-size slot with DLAA runs here, with this frame's motion. Nothing
+ // above reads its output: the optical flow encodes the converted input.
+ if(!sourcePostPasses_.empty()&&sourcePostAfterFlow()){
+ if(!dispatchSlotPasses(list,sourcePostPasses_,slot,"source-size",!sourcePostExecutionLogged_,reset))return false;
+ tracker_.transition(list,sourcePostOutput_,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+ sourcePostExecutionLogged_=true;
+ if (desc_.stageMark) desc_.stageMark("source-size-pass");
+ cpuTrace.mark("sourcePass");
+ }
+ // NR inference reuse (NrReuse.h), decided after this frame's flow and before
+ // any NR layer records work: a reused frame skips the whole NR chain. Only a
+ // preview graph that asked for it has the pass; every other graph is unchanged.
+ bool nrReuseFrame=false,nrAfterReuse=false;
+ if(nrReusePass_&&nrEnabled_&&nrCreated()){
+ if(reset){nrReuseScheduler_.reset();nrReuseKeyValid_=false;}
+ nrAfterReuse=nrReuseScheduler_.lastReused();
+ if(haveFlow){
+ nrReusePass_->compose(list,tracker_,nrAfterReuse);
+ nrReuseFrame=nrReuseScheduler_.next(nrReuseKeyValid_&&!reset&&!pausedResidualRefresh&&!reusePausedNr);
+ // The inferred frame after a reused one: NR's own history is the
+ // frame before the reused one, so its motion input is the chained
+ // motion back to that frame, not this frame's one-step flow.
+ if(!nrReuseFrame&&nrAfterReuse&&desc_.nrUsesFlow()){
+ nrReusePass_->writeMotionTargets(list,tracker_);++metrics_.nrReuseChainedMotion;
+ }
+ }else nrReuseScheduler_.next(false);
+ }
if(reset){++metrics_.resetCount;++epoch_;}
out.historyReset=reset;
out.batch.batchId=realFrameIndex_+1;out.batch.identity={epoch_,desc_.settingsRevision,sourceFrameId};
@@@ -4327,8 -4069,9 +4454,9 @@@ void EnhanceGraph::shutdown(
proxyTex_.Reset();
for(auto& r:sourceReferences_)r.Reset();for(auto& r:baseReferences_)r.Reset();workRgba_.Reset();
preGradeRgba_.Reset();srcRgba_.Reset();videoSrInput_.Reset();videoSrOutput_.Reset();srPrescaled_.Reset();
- firstSrInput_.Reset();firstSrOutput_.Reset();firstSrLinear_.Reset();
+ firstSrInput_.Reset();firstSrOutput_.Reset();firstSrLinear_.Reset();firstSrFlow_.Reset();secondSrFlow_.Reset();fsrAuxW_=fsrAuxH_=0;
nrHoldPass_.reset();
+ nrReusePass_.reset();
colorDetail_.close();
chromaTex_.Reset();
lumaTex_.Reset();