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

feat(engine): pin Video HDR in front of frame generation

Veyra Goal Agent2aacf37469dd
diff --git a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md b/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
index bab2ed4a..be807d58 100644
--- a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
+++ b/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
@@ -18,7 +18,7 @@
| S0.4 | 性能 / 延迟基线 | 完成 | `checkpoint/ui-mig-s0` | 4 种播放场景 |
| S1.1 | 合并图描述构建 | 完成 | `checkpoint/ui-mig-s1.1` | 6 处合并为 `describeStages()`;13 项哈希一致 |
| S1.7 | 快照补字段(宽高比 / 时长 / 封面) | 完成 | `checkpoint/ui-mig-s1.7` | 宽高比与时长实测正确;关键哈希一致 |
-| S1.2+S1.3 | 效果链模型与效果注册表 | 完成 | `checkpoint/ui-mig-s1.2` | 34 项单元检查全过;引擎尚未改用它 |
+| S1.2+S1.3 | 效果链模型与效果注册表 | 完成 | `checkpoint/ui-mig-s1.2` | 40 项单元检查全过;引擎尚未改用它 |
## 发现并修复的 bug
@@ -36,7 +36,7 @@
- `EffectType` 六种(调色、超分辨率、NR、保护区域、RTX Video HDR、补帧),每种在 `effectCatalog()` 里登记名称、实例上限(调色 6、NR 4、其余 1)、是否可重复、是否必须最后、是否改变分辨率、是否实验;
- `ChainNode` 每节点带自己的载荷(NR 的参数与运行版本、保护区域、调色、Video HDR),NR 的每层参数独立;
- `EffectChain` 固定容量 16 节点 + `nodeCount` + 模式(列表 / 节点)+ 补帧倍率,整体可平凡复制(导出共享内存要求的静态断言仍然成立);
- - `validateChain()`:数量上限、补帧只能最后、RTX Video HDR 之后只能接补帧;
+ - `validateChain()`:数量上限、补帧只能最后、**RTX Video HDR 锁死在补帧前面**(用户 2026-09-25 决定,两种模式都不能拖动它;它和补帧之间不允许存在其它启用节点,它也不能排到补帧之后);
- `toChain()` / `fromChain()`:与 `EnhancementSettings` 双向转换,转换不会碰采集、音频、导出等非阶段字段;
- `requiresGraphRebuild()`:把“哪些变化要重建管线”从 `EngineController` 里 25 个字段的手写“或”判断收进一处。
- 这一步只是把结构立起来,**引擎仍然使用 `EnhancementSettings`**,行为一字未改;`applySettings` 里原本的拒绝规则继续生效。
diff --git a/include/veyra/engine/EffectChain.h b/include/veyra/engine/EffectChain.h
index 1675d522..8552e9cf 100644
--- a/include/veyra/engine/EffectChain.h
+++ b/include/veyra/engine/EffectChain.h
@@ -142,7 +142,12 @@ struct EffectInfo {
std::string_view label;
uint32_t maxInstances = 1;
bool repeatable = false;
+ // mustBeLast: the stage runs after the whole chain (frame generation).
+ // justBeforeLast: the stage must sit immediately in front of it, because
+ // what follows would change the colour domain it just produced (Video HDR).
+ // The UI keeps both pinned; neither can be dragged.
bool mustBeLast = false;
+ bool justBeforeLast = false;
bool changesResolution = false;
bool experimental = false;
};
diff --git a/src/engine/EffectChain.cpp b/src/engine/EffectChain.cpp
index 64bc3a3f..cbc0474d 100644
--- a/src/engine/EffectChain.cpp
+++ b/src/engine/EffectChain.cpp
@@ -5,12 +5,12 @@
namespace veyra::engine {
namespace {
constexpr std::array<EffectInfo, effectTypeCount> kCatalog{{
- {EffectType::Color, effectTypeName(EffectType::Color), "调色", kMaxColorInstances, true, false, false, false},
- {EffectType::SuperResolution, effectTypeName(EffectType::SuperResolution), "超分辨率", 1, false, false, true, false},
- {EffectType::NrEnhance, effectTypeName(EffectType::NrEnhance), "NR 画面增强", kMaxNrInstances, true, false, false, true},
- {EffectType::Protection, effectTypeName(EffectType::Protection), "NR 保护区域", 1, false, false, false, false},
- {EffectType::VideoHdr, effectTypeName(EffectType::VideoHdr), "RTX Video HDR", 1, false, false, false, false},
- {EffectType::FrameGeneration, effectTypeName(EffectType::FrameGeneration), "补帧", 1, false, true, false, false},
+ {EffectType::Color, effectTypeName(EffectType::Color), "调色", kMaxColorInstances, true, false, false, false, false},
+ {EffectType::SuperResolution, effectTypeName(EffectType::SuperResolution), "超分辨率", 1, false, false, false, true, false},
+ {EffectType::NrEnhance, effectTypeName(EffectType::NrEnhance), "NR 画面增强", kMaxNrInstances, true, false, false, false, true},
+ {EffectType::Protection, effectTypeName(EffectType::Protection), "NR 保护区域", 1, false, false, false, false, false},
+ {EffectType::VideoHdr, effectTypeName(EffectType::VideoHdr), "RTX Video HDR", 1, false, false, true, false, false},
+ {EffectType::FrameGeneration, effectTypeName(EffectType::FrameGeneration), "补帧", 1, false, true, false, false, false},
}};
} // namespace
@@ -44,14 +44,23 @@ ChainValidation validateChain(const EffectChain& chain) {
return {false, "补帧只能放在链路最后"};
}
}
- // Video HDR turns an SDR frame into an HDR one; the stages after it must be
- // able to consume HDR. Only frame generation is allowed to follow.
- for (uint32_t i = 0; i < chain.nodeCount; ++i) {
- if (chain.nodes[i].type != EffectType::VideoHdr || !chain.nodes[i].enabled) continue;
- for (uint32_t j = i + 1; j < chain.nodeCount; ++j) {
- const auto type = chain.nodes[j].type;
- if (!chain.nodes[j].enabled) continue;
- if (type != EffectType::FrameGeneration) return {false, "RTX Video HDR 之后只能接补帧"};
+ // Video HDR turns an SDR frame into an HDR one, and the stages after it
+ // would need HDR-aware handling that only frame generation has. It is
+ // therefore pinned immediately in front of frame generation: no other
+ // enabled stage may sit between them, and nothing else may follow it.
+ {
+ int32_t hdrIndex = -1, fgIndex = -1;
+ for (uint32_t i = 0; i < chain.nodeCount; ++i) {
+ if (!chain.nodes[i].enabled) continue;
+ if (chain.nodes[i].type == EffectType::VideoHdr) hdrIndex = int32_t(i);
+ if (chain.nodes[i].type == EffectType::FrameGeneration) fgIndex = int32_t(i);
+ }
+ if (hdrIndex >= 0) {
+ if (fgIndex >= 0 && hdrIndex > fgIndex) return {false, "RTX Video HDR 只能放在补帧前面"};
+ for (uint32_t j = uint32_t(hdrIndex) + 1; j < chain.nodeCount; ++j) {
+ if (!chain.nodes[j].enabled) continue;
+ if (chain.nodes[j].type != EffectType::FrameGeneration) return {false, "RTX Video HDR 之后只能接补帧"};
+ }
}
}
return {};
diff --git a/tests/unit/EffectChainTests.cpp b/tests/unit/EffectChainTests.cpp
index 6ce8a677..09972e4b 100644
--- a/tests/unit/EffectChainTests.cpp
+++ b/tests/unit/EffectChainTests.cpp
@@ -137,6 +137,22 @@ int main() {
ok.nodes[1] = ChainNode{}; ok.nodes[1].type = EffectType::FrameGeneration; ok.nodes[1].enabled = true;
ok.nodes[2] = ChainNode{}; ok.nodes[2].type = EffectType::NrEnhance; ok.nodes[2].enabled = false;
check(validateChain(ok).accepted, "a disabled stage after Video HDR is allowed");
+
+ // Video HDR is pinned in front of frame generation: an enabled stage
+ // between them would have to consume HDR, which only FG can do.
+ EffectChain between;
+ between.nodeCount = 3;
+ between.nodes[0] = ChainNode{}; between.nodes[0].type = EffectType::VideoHdr; between.nodes[0].enabled = true;
+ between.nodes[1] = ChainNode{}; between.nodes[1].type = EffectType::Color; between.nodes[1].enabled = true;
+ between.nodes[2] = ChainNode{}; between.nodes[2].type = EffectType::FrameGeneration; between.nodes[2].enabled = true;
+ check(!validateChain(between).accepted, "an enabled stage between Video HDR and frame generation is rejected");
+
+ // Video HDR after frame generation is also refused.
+ EffectChain afterFg;
+ afterFg.nodeCount = 2;
+ afterFg.nodes[0] = ChainNode{}; afterFg.nodes[0].type = EffectType::FrameGeneration; afterFg.nodes[0].enabled = true;
+ afterFg.nodes[1] = ChainNode{}; afterFg.nodes[1].type = EffectType::VideoHdr; afterFg.nodes[1].enabled = true;
+ check(!validateChain(afterFg).accepted, "Video HDR after frame generation is rejected");
}
// 6. Instance limits come from the catalog.
@@ -155,6 +171,10 @@ int main() {
effectInfo(EffectType::NrEnhance).maxInstances == kMaxNrInstances,
"the catalog marks NR as repeatable up to the ceiling");
check(effectInfo(EffectType::FrameGeneration).mustBeLast, "the catalog marks frame generation as last");
+ check(effectInfo(EffectType::VideoHdr).justBeforeLast && !effectInfo(EffectType::VideoHdr).mustBeLast,
+ "the catalog pins Video HDR in front of frame generation");
+ check(!effectInfo(EffectType::NrEnhance).mustBeLast && !effectInfo(EffectType::NrEnhance).justBeforeLast,
+ "NR is not pinned to a fixed position");
}
// 7. Rebuild rules: shape changes rebuild, live parameters do not.