From 55e77bfc8a5bc8a041e297b8c49c3711dece04eb Mon Sep 17 00:00:00 2001 From: dfattal Date: Wed, 19 Aug 2026 02:22:20 -0700 Subject: [PATCH 1/2] chore: bump the plugin pin to upm/v2.12.1 in all 4 samples (DisplayXR/displayxr-unity#254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2.12.0 -> v2.12.1 (transparent-overlay click-through hit test no longer CPU-skins and ray-scans renderers that are disabled or on inactive GameObjects; drops a per-frame mesh.triangles allocation; adds a bounds pre-check before the triangle scan; declares the previously-undeclared com.unity.inputsystem dependency). The com.displayxr.unity packages-lock.json entries are DELETED rather than hash-refreshed, so Unity re-resolves the git dependency from scratch on next open — the lock caches the pinned commit SHA, and the plugin's dependency set changed in this release (inputsystem is now declared), so a hand-edited hash would leave a stale dependency block behind. Co-Authored-By: Claude Fable 5 --- samples/birp-multipass/Packages/manifest.json | 2 +- samples/birp-multipass/Packages/packages-lock.json | 9 --------- samples/desktop-avatar/Packages/manifest.json | 2 +- samples/desktop-avatar/Packages/packages-lock.json | 9 --------- samples/hdrp-singlepass-ui/Packages/manifest.json | 2 +- samples/hdrp-singlepass-ui/Packages/packages-lock.json | 9 --------- samples/urp-singlepass-ui/Packages/manifest.json | 2 +- samples/urp-singlepass-ui/Packages/packages-lock.json | 9 --------- 8 files changed, 4 insertions(+), 40 deletions(-) diff --git a/samples/birp-multipass/Packages/manifest.json b/samples/birp-multipass/Packages/manifest.json index a0e38ee..d2ce55f 100644 --- a/samples/birp-multipass/Packages/manifest.json +++ b/samples/birp-multipass/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", + "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.1", "com.unity.multiplayer.center": "1.0.1", "com.unity.ugui": "2.0.0", "com.unity.xr.management": "4.5.2", diff --git a/samples/birp-multipass/Packages/packages-lock.json b/samples/birp-multipass/Packages/packages-lock.json index f1e06be..5562112 100644 --- a/samples/birp-multipass/Packages/packages-lock.json +++ b/samples/birp-multipass/Packages/packages-lock.json @@ -1,14 +1,5 @@ { "dependencies": { - "com.displayxr.unity": { - "version": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", - "depth": 0, - "source": "git", - "dependencies": { - "com.unity.xr.management": "4.4.0" - }, - "hash": "d1f0250527d6bc7da17c952a77dcdf4351ac02a5" - }, "com.unity.inputsystem": { "version": "1.19.0", "depth": 1, diff --git a/samples/desktop-avatar/Packages/manifest.json b/samples/desktop-avatar/Packages/manifest.json index 1fa6981..b3fede7 100644 --- a/samples/desktop-avatar/Packages/manifest.json +++ b/samples/desktop-avatar/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", + "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.1", "com.unity.multiplayer.center": "1.0.1", "com.unity.render-pipelines.universal": "17.0.4", "com.unity.ugui": "2.0.0", diff --git a/samples/desktop-avatar/Packages/packages-lock.json b/samples/desktop-avatar/Packages/packages-lock.json index 1259508..7da3ac0 100644 --- a/samples/desktop-avatar/Packages/packages-lock.json +++ b/samples/desktop-avatar/Packages/packages-lock.json @@ -1,14 +1,5 @@ { "dependencies": { - "com.displayxr.unity": { - "version": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", - "depth": 0, - "source": "git", - "dependencies": { - "com.unity.xr.management": "4.4.0" - }, - "hash": "d1f0250527d6bc7da17c952a77dcdf4351ac02a5" - }, "com.unity.burst": { "version": "1.8.28", "depth": 2, diff --git a/samples/hdrp-singlepass-ui/Packages/manifest.json b/samples/hdrp-singlepass-ui/Packages/manifest.json index 945eed2..bfa5724 100644 --- a/samples/hdrp-singlepass-ui/Packages/manifest.json +++ b/samples/hdrp-singlepass-ui/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", + "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.1", "com.unity.multiplayer.center": "1.0.1", "com.unity.render-pipelines.high-definition": "17.0.4", "com.unity.ugui": "2.0.0", diff --git a/samples/hdrp-singlepass-ui/Packages/packages-lock.json b/samples/hdrp-singlepass-ui/Packages/packages-lock.json index a32103f..218f0a6 100644 --- a/samples/hdrp-singlepass-ui/Packages/packages-lock.json +++ b/samples/hdrp-singlepass-ui/Packages/packages-lock.json @@ -1,14 +1,5 @@ { "dependencies": { - "com.displayxr.unity": { - "version": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", - "depth": 0, - "source": "git", - "dependencies": { - "com.unity.xr.management": "4.4.0" - }, - "hash": "d1f0250527d6bc7da17c952a77dcdf4351ac02a5" - }, "com.unity.burst": { "version": "1.8.28", "depth": 2, diff --git a/samples/urp-singlepass-ui/Packages/manifest.json b/samples/urp-singlepass-ui/Packages/manifest.json index 1fa6981..b3fede7 100644 --- a/samples/urp-singlepass-ui/Packages/manifest.json +++ b/samples/urp-singlepass-ui/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", + "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.1", "com.unity.multiplayer.center": "1.0.1", "com.unity.render-pipelines.universal": "17.0.4", "com.unity.ugui": "2.0.0", diff --git a/samples/urp-singlepass-ui/Packages/packages-lock.json b/samples/urp-singlepass-ui/Packages/packages-lock.json index 1259508..7da3ac0 100644 --- a/samples/urp-singlepass-ui/Packages/packages-lock.json +++ b/samples/urp-singlepass-ui/Packages/packages-lock.json @@ -1,14 +1,5 @@ { "dependencies": { - "com.displayxr.unity": { - "version": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.12.0", - "depth": 0, - "source": "git", - "dependencies": { - "com.unity.xr.management": "4.4.0" - }, - "hash": "d1f0250527d6bc7da17c952a77dcdf4351ac02a5" - }, "com.unity.burst": { "version": "1.8.28", "depth": 2, From 37c7e49e8286ac4fc01ea3ea322ddf8f28208a96 Mon Sep 17 00:00:00 2001 From: dfattal Date: Wed, 19 Aug 2026 02:24:48 -0700 Subject: [PATCH 2/2] desktop-avatar: cap the speech-bubble Local2D refresh at 4 Hz (DisplayXR/displayxr-unity#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bubble is a static panel of text, but its Local2D layer re-rendered every frame: an enabled offscreen camera plus the provider's full-RT bridge copy, all to redraw identical pixels. Set maxRefreshHz = 4f and announce the two content changes explicitly via a MarkBubbleDirty() helper (build, and the Ctrl+Shift+L layout-mode toggle, whose both branches rewrite the title/body text). The component itself force-refreshes when the pixel rect moves, which already covers the split drag and window resizes. Verified static: TigerSpeechBubble is the only writer of the bubble's Text components in this sample, and the only DisplayXRLocal2D user — the tuning HUD is a separate DisplayXRWindowSpaceUI canvas, unaffected. maxRefreshHz / SetDirty need plugin >= v2.11.0; satisfied by the v2.12.1 pin in the preceding commit. Ported from the verified downstream avatar app. Co-Authored-By: Claude Fable 5 --- .../Assets/TigerSpeechBubble.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/samples/desktop-avatar/Assets/TigerSpeechBubble.cs b/samples/desktop-avatar/Assets/TigerSpeechBubble.cs index ca9a549..9ac7994 100644 --- a/samples/desktop-avatar/Assets/TigerSpeechBubble.cs +++ b/samples/desktop-avatar/Assets/TigerSpeechBubble.cs @@ -256,6 +256,7 @@ private void SetLayoutMode(bool on) PlayerPrefs.SetFloat(kBandPrefKey, bubbleBandFraction); PlayerPrefs.Save(); } + MarkBubbleDirty(); // both branches rewrite the bubble's title/body text Debug.Log($"[TigerSpeechBubble] Layout mode {(on ? "ON — drag to set the 2D/3D split" : "OFF")} " + $"(split={bubbleBandFraction:P0}; restart for crisp rendering at the new split)"); } @@ -299,9 +300,18 @@ void BuildUI() m_BubbleL2D = l2dGO.AddComponent(); m_BubbleL2D.resolution = new Vector2Int(1024, 640); m_BubbleL2D.useExplicitRect = true; // we supply the exact panel-px rect + // Cap the overlay refresh (displayxr-unity#244). The bubble is a static + // panel of text — nothing animates in it — so the enabled offscreen camera + // and the provider's full-RT bridge copy are pure per-frame waste. 4 Hz caps + // the worst case for a content change we failed to announce at 250 ms while + // dropping ~93% of those renders at 60 fps. Content changes go through + // MarkBubbleDirty(); the component itself force-refreshes when the pixel rect + // moves, which covers the split drag and window resizes. + m_BubbleL2D.maxRefreshHz = 4f; BuildBubble(l2dGO.transform); m_BubbleL2DGO = l2dGO; l2dGO.SetActive(true); + MarkBubbleDirty(); Debug.Log($"[TigerSpeechBubble] BUILD v11 (simple-window): client={m_PanelW}x{m_PanelH}; " + $"bubbleBand={bubbleBandFraction:P0} (top); press B to toggle window decoration."); @@ -384,6 +394,15 @@ void ApplyLayout() } } + // The Local2D refresh is capped (see BuildUI), so every change to what the + // bubble canvas draws has to announce itself here — otherwise the new content + // sits invisible until the next permitted slot. The component consumes the flag + // in its LateUpdate, so a call from our Update lands on this same frame's render. + private void MarkBubbleDirty() + { + if (m_BubbleL2D != null) m_BubbleL2D.SetDirty(); + } + // ------------------------------------------------------------ canvas rect --- private void PushCanvasRect(int x, int y, int w, int h)