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

Fix software-rendered menu text oscillation at spring landing

Veyra Goal Agent05181bfa41d0
diff --git a/docs/MENU_TEXT_JITTER_2026-11-06.md b/docs/MENU_TEXT_JITTER_2026-11-06.md
new file mode 100644
index 00000000..d4bbcfa3
--- /dev/null
+++ b/docs/MENU_TEXT_JITTER_2026-11-06.md
@@ -0,0 +1,91 @@
+# 选框弹出时文字“抖两下”:软件绘制下弹簧到终点即停(2026-11-06)
+
+- **分支**:`claude/menu-jitter-20261106`,工作树 `E:/项目/Veyra/worktrees/claude-menu-jitter-20261106`。
+- **基线**:main `f1f8298`。
+- **状态**:未提交,未合并,未 push/Release。
+
+**用户要求**:“现在点击弹出的选框,文字总是会抖动两下,看起来蛮奇怪的,看看是啥问题。”
+
+**来回经过**:
+
+1. 用户先以为这个修复改掉了弹簧动画,叫停并要求保持原样。修复因此撤回过一次。
+2. 随后用户更正:“我看错了……还是继续修复!修复效果是正确的。”
+3. 本文是恢复后的最终结果。
+
+## 原因
+
+菜单 `VMenu` 打开时有两个动画:
+
+- 缩放从 0.9 到 1,450 ms,用 `Theme.spring` 弹簧曲线;
+- 向上移 8 像素,用同一条曲线。
+
+**弹簧在终点附近来回越过终点**:曲线在 24% 冲到 1.043,44.1% 回到 0.99,60.7% 是 1.001,100% 才停在 1。所以缩放大约在 87、181、266 ms 越过 1,450 ms 停住。
+
+**软件绘制把文字放在整像素上**:
+
+- 软件绘制是 2.1.1 起的默认。它把文字横坐标向下取整:文字只要比停稳位置偏左一点点,就画到左边一整像素处。
+- 这是根据测量推断的:缩放 1.0001 时偏 −0.005 像素,画成 −1;缩放 0.999 时偏 +0.05 像素,画成 0。
+
+**两者叠加的结果**:菜单中线左边的文字在缩放大于 1 的两段时间里各左跳一次,中线右边的文字在缩放小于 1 时跳。这就是“抖两下”。
+
+**GPU 绘制为什么不跳**:同一段弹簧只是不到半像素的平滑移动。2.0.7 用的是同一份 QML,界面是 GPU 绘制,所以没有这个现象。
+
+**和 2026-10-26 那次修复的关系**:那次修的是首次打开时第一行字从 y=14 跳到 42 的布局问题,和这次不是同一个问题,那次的修复保留。
+
+## 改动
+
+**`qml/Veyra/VMenu.qml`**:
+
+- 新属性 `holdLanding`,用软件绘制判断:`vySoftwareUi`,或 `GraphicsInfo.api === Software`。写法和 `VIcon`、`ProAddLayerButton` 相同。
+- 打开时,弹簧第一次到达 1 后,界面上的缩放和位移就停在 1 和 0。
+- 原来的 `enter`/`exit` 过渡、曲线和时长都不变;内部 `motion.s`/`dy` 仍完整走完弹簧,`motionScale` 探针照旧。
+- 关闭动画不受影响:`aboutToHide` 时清掉落点标记。
+- GPU 绘制下 `holdLanding` 为 false,画面和以前完全一样。
+
+**`tests/qml/quick/tst_menu_layout.qml`**:
+
+- 新增 `test_open_spring_lands_once`,分两行数据:
+ - **软件这一行**:用菜单自身的绑定,确认弹簧原值仍会冲过 1.001;画出的缩放和位移不越过终点;文字只靠近、不远离,落点后与停稳位置一致;关闭仍会缩小。
+ - **另一行**:关掉 `holdLanding`,确认画出的值就是完整弹簧。
+ - 两行都检查绑定跟随渲染方式。
+- `test_rendered_spring_text` 截取的是指定缩放下的画面,所以截图期间临时关掉 `holdLanding`。
+
+## 验证
+
+**构建**:`build/claude-menu-jitter-20261106`,按 main 配置,构建步骤只复制 QML。
+
+**QtQuick 测试**,环境同 `scripts/acceptance/menu-amd-hdr-fix.py`:Windows 平台、私有临时目录和配置:
+
+- 菜单两项测试在五种组合下全部通过:
+ - 软件 100%、150%、200%:各 6 过,0 失败;
+ - d3d12 100%、150%:各 5 过,0 失败,跳过 1 项(软件专用那一行)。
+- 全套软件绘制:147 过,0 失败,跳过 1 项。跳过的是需要截图目录的 `test_rendered_spring_text`;它单独加截图目录运行,3 项通过,6 档缩放下文字位置随缩放变化,说明截图期间确实关掉了停住逻辑。
+
+**真实程序录屏**:
+
+- 程序是 2.1.2 测试包的私有副本,只换了 `VMenu.qml`(与 main 只差这一处)。屏幕 320 Hz,缩放 100%。
+- 用注入的探针在 Pro 页把“超分后端”选框开、关 3 次,ffmpeg `ddagrab` 以 240 fps 无损录菜单区域,逐个不同帧跟踪“DLSS SR”这行字。
+
+| 版本 | 软件绘制 | GPU 绘制 |
+|---|---|---|
+| 原版 | 3 次都在约 66–154 ms 和 250–420 ms 左移 1 像素再回来 | 平滑,约 100 ms 时越过终点 0.2 像素,约 250 ms 停稳 |
+| 修复 | 3 次都一路靠拢,约 50–67 ms 落点,之后只剩淡入,没有出现 −1 | 与原版相同 |
+
+- 第一段 GPU 修复录像里,第一次打开约 250 ms 后菜单就被关闭了,是偶发。GPU 绘制下这次修复不起作用;重录一次,3 次打开都正常。
+
+**手动入口**:`E:/项目/Veyra/tests/claude-menu-jitter-20261106/启动选框修复测试.cmd`。
+
+- 使用私有配置,默认软件绘制。启动冒烟测试:退出码 0,日志显示软件绘制。
+- 这个入口必须是纯 ASCII:之前的 UTF-8 版本在 `chcp` 切换后被 cmd 读乱了。
+
+## 没有验证的部分
+
+- **缩放比例**:真实程序只在 100% 缩放下录了屏;150%、200% 只在 QtQuick 测试里验证过逻辑。
+- **其他机器**:用户的机器、RTSS 或 OBS 兼容模式下没有实测。这两种模式同样是软件绘制,走同一条路径。
+- **其他动画**:对话框(`DialogLayer`、`VConfirm`)、`VAccordion`、`VRise` 也是“弹簧+缩放/位移”,软件绘制下可能有同类的 1 像素跳动。这次没有测量,也没有改。
+
+## 产物
+
+- **报告与回执**:`E:/项目/Veyra/reports/claude-menu-jitter-20261106/`,包括 `FINDINGS.md`、`FINAL.json`、跟踪结果、探针与脚本。
+- **录像**:`E:/项目/Veyra/tests/claude-menu-jitter-20261106/{base,fix}-*.mkv`。
+- **日志**:`E:/项目/Veyra/logs/claude-menu-jitter-20261106/`。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index aa4cc8b7..53292734 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -617,3 +617,20 @@ PID61528,用户直接运行2.1.2 NVIDIA包;不激活窗口、不启动额外
验证:SR设置240、VFG设置683、能力80、VFG模块342、HIP单元15/真实HIP6枚举可见性19、worker诊断14、GPU协议54、原生VFG GPU2425、效果链/预设/NR模型/UI合同/i18n通过。QtQuick最终146/0/0;实际界面15项冷/热两轮通过。7组各60帧SR导出无错位;H.264/HEVC各270帧,IDR0/120/240且原始stss1/121/241。首轮测试参数及Qt模块/截图目录部署缺口保留失败,修正夹具后重测,未为夹具失败修改产品。冷启动新VFX模型12.4秒JIT曾触发无进展诊断;热缓存1.3–1.5秒无engine/QML错误,保留首开停顿限制。没有30系/RX7000本地推理或新超分HDR通过声明。上游许可原文字节保留,其新增文件EOF空行的diff-check提示不擅改许可;本轮其余差异check通过。
合并后仅删除已合入且无工作树检出的本地冗余分支,SHA/分支映射和保护检查见reports/main-integration-20261105;不删旧脏树、依赖、正式包和用户文件。NR仅完成三个设计方向研究及真实参数映射建议,未改NR界面。当前事实及最终状态读docs/MAIN_INTEGRATION_2026-11-05.md和回执FINAL.json;未push/Release。
+
+## 2026-11-06 选框弹出文字“抖两下”(Claude)
+
+分支 `claude/menu-jitter-20261106`,基线 main `f1f8298`,未提交。
+
+**原因**:软件绘制(2.1.1 起默认)把文字横坐标向下取整到整像素。VMenu 打开的弹簧缩放在终点附近越过 1 三次(约 87、181、266 ms),每次越过都把选项文字左移 1 像素再移回,共两次。GPU 绘制下同一段弹簧是不到半像素的平滑移动,不跳。
+
+**改动**:只在软件绘制下,弹簧第一次到达终点后,缩放和位移就停在终点;GPU 绘制以及 enter/exit 的曲线和时长不变。用户一度误以为弹簧被改掉、叫停,撤回后又确认“修复效果是正确的”,恢复原补丁。
+
+**验证**:
+- 菜单 QtQuick 测试:软件 100/150/200% 各 6/0,d3d12 100/150% 各 5/0/1。
+- 全套 QtQuick:147/0/1;截图用例单独 3/0。
+- 240 fps 录屏:软件原版 3 次都左跳 1 像素来回两次;修复后 3 次都一路靠拢、无回跳。GPU 修复后与原版相同。
+
+**入口与记录**:手动入口 `tests/claude-menu-jitter-20261106/启动选框修复测试.cmd`。执行记录 `docs/MENU_TEXT_JITTER_2026-11-06.md`,回执 `E:/项目/Veyra/reports/claude-menu-jitter-20261106/FINAL.json`。
+
+**未验证**:真实程序只在 100% 缩放下录屏;对话框等同类弹簧缩放没有测,也没有改。
diff --git a/qml/Veyra/VMenu.qml b/qml/Veyra/VMenu.qml
index f68e5136..ec657314 100644
--- a/qml/Veyra/VMenu.qml
+++ b/qml/Veyra/VMenu.qml
@@ -100,6 +100,18 @@ Popup {
property real originX: width / 2
// For the motion probe.
readonly property real motionScale: motion.s
+ // Software drawing (the default since 2.1.1) puts every glyph on a whole
+ // pixel, and a label left of its place by any fraction lands a full pixel
+ // left. The spring's tail swings scale and lift past their end values and
+ // back (1.043, 0.99 and 1.001 of the way at 24%, 44% and 61%), under half
+ // a pixel on a normal menu, so each opening moved every label 1 px
+ // sideways and back twice (screen recordings, 2026-11-06). With software
+ // drawing the opening therefore stops where the spring first reaches its
+ // end; GPU drawing still draws the whole spring.
+ property bool holdLanding: (typeof vySoftwareUi !== "undefined" && vySoftwareUi)
+ || contentItem.GraphicsInfo.api === GraphicsInfo.Software
+ onAboutToShow: { motion.opening = true; motion.landed = false }
+ onAboutToHide: { motion.opening = false; motion.landed = false }
parent: Overlay.overlay
padding: 0
@@ -124,7 +136,16 @@ Popup {
NumberAnimation { target: motion; property: "dy"; to: 8; duration: Theme.d(450); easing.bezierCurve: Theme.spring }
}
}
- QtObject { id: motion; property real s: 1; property real dy: 0 }
+ QtObject {
+ id: motion
+ property real s: 1
+ property real dy: 0
+ // Set once the opening spring first reaches 1; holdLanding keeps it there.
+ property bool opening: false
+ property bool landed: false
+ onSChanged: if (opening && s >= 1) landed = true
+ readonly property bool held: landed && pop.holdLanding
+ }
// Popup itself is not an Item, so one content item carries the shadow, the panel
// and the list, and the scale/translate motion with them.
@@ -136,10 +157,10 @@ Popup {
Scale {
origin.x: pop.originX
origin.y: pop.above ? pop.height : 0
- xScale: motion.s
- yScale: motion.s
+ xScale: motion.held ? 1 : motion.s
+ yScale: motion.held ? 1 : motion.s
},
- Translate { y: motion.dy }
+ Translate { y: motion.held ? 0 : motion.dy }
]
// box-shadow: 0 24px 50px -12px rgba(0,0,0,.8): the -12px spread insets the
// shadow's shape, the offset and blur come from the effect.
diff --git a/tests/qml/quick/tst_menu_layout.qml b/tests/qml/quick/tst_menu_layout.qml
index 200515d6..0f52dbf1 100644
--- a/tests/qml/quick/tst_menu_layout.qml
+++ b/tests/qml/quick/tst_menu_layout.qml
@@ -74,6 +74,9 @@ Item {
for(const animation of group.animations || [])
if(animation.property==="s")motion=animation.target
verify(motion!==null)
+ // These frames draw the named scales, so keep software drawing off its hold.
+ const keepHold=menu.holdLanding
+ menu.holdLanding=false
let frames=[]
for(const scale of [1,0.9,0.95,0.99,1.02,1.04]) {
motion.s=scale;motion.dy=0
@@ -85,8 +88,75 @@ Item {
}
console.log("MENU_RASTER_FRAMES "+JSON.stringify(frames))
motion.s=1;motion.dy=0
+ menu.holdLanding=keepHold
menu.close();tryCompare(menu,"visible",false)
}
+ // Software drawing puts labels on whole pixels, so the spring's tail
+ // around its end moved them 1 px sideways and back twice per opening.
+ function test_open_spring_lands_once_data() {
+ return [{tag:"software hold",hold:true},{tag:"full spring",hold:false}]
+ }
+ function test_open_spring_lands_once(data) {
+ root.Window.window.width=900;root.Window.window.height=600
+ root.width=900;root.height=600
+ let popup=null
+ for(const child of warningSelect.data)
+ if(child instanceof VMenu) popup=child
+ verify(popup!==null)
+ const software=root.GraphicsInfo.api===GraphicsInfo.Software
+ if(data.hold&&!software) skip("the hold belongs to software drawing")
+ const keepHold=popup.holdLanding
+ // The menu was shown by the earlier tests, so its binding knows the renderer.
+ compare(keepHold,software,"the hold follows the renderer")
+ // The software row keeps the menu's own binding, the other turns it off.
+ if(!data.hold) popup.holdLanding=false
+ mouseClick(warningSelect,warningSelect.width/2,warningSelect.height/2)
+ tryVerify(()=>popup.visible)
+ compare(popup.holdLanding,data.hold)
+ const label=labels(popup.contentItem,[])[0]
+ const scale=popup.contentItem.transform[0],lift=popup.contentItem.transform[1]
+ // Wait for the transition's first tick (motion.s keeps the last value until then).
+ for(let i=0;i<200&&popup.motionScale>=1;++i) wait(1)
+ let frames=[]
+ while(!popup.opened&&frames.length<600) {
+ const p=label.mapToItem(null,0,0)
+ frames.push({raw:popup.motionScale,s:scale.xScale,dy:lift.y,x:p.x,y:p.y})
+ wait(2)
+ }
+ verify(popup.opened)
+ const end=label.mapToItem(null,0,0)
+ verify(frames.length>4,"sampled "+frames.length+" frames")
+ verify(Math.max(...frames.map(f=>f.raw))>1.001,"the approved spring must still overshoot")
+ if(data.hold) {
+ let landed=false
+ for(let i=0;i<frames.length;++i) {
+ const f=frames[i]
+ verify(f.s<=1&&f.dy>=0,"frame "+i+" went past the end: "+JSON.stringify(f))
+ if(i>0) {
+ const g=frames[i-1]
+ verify(Math.abs(f.x-end.x)<=Math.abs(g.x-end.x)+1e-6&&Math.abs(f.y-end.y)<=Math.abs(g.y-end.y)+1e-6,
+ "label moved away from its place: "+JSON.stringify([g,f,end]))
+ }
+ if(landed) {
+ compare(f.s,1);compare(f.dy,0)
+ fuzzyCompare(f.x,end.x,1e-6);fuzzyCompare(f.y,end.y,1e-6)
+ }
+ landed=landed||f.s===1
+ }
+ verify(frames.some(f=>f.s===1&&f.raw>1.001),"the hold must cover the spring's overshoot")
+ } else {
+ for(const f of frames)
+ compare(f.s,f.raw,"without the hold the drawn scale is the spring")
+ verify(Math.max(...frames.map(f=>f.s))>1.001,"GPU drawing keeps the whole spring")
+ }
+ console.log("MENU_SPRING_LANDING "+data.tag+" frames="+frames.length+" software="+software)
+ popup.close()
+ let exitMin=1
+ while(popup.visible&&exitMin>0.95) { exitMin=Math.min(exitMin,scale.xScale);wait(2) }
+ verify(exitMin<=0.95,"closing must still scale the menu down: "+exitMin)
+ tryCompare(popup,"visible",false)
+ if(!data.hold) popup.holdLanding=keepHold
+ }
function test_mjpeg_warning() {
compare(warningSelect.valueColor,Theme.err)
warningSelect.value="NV12"