Skip to content

Always render world viewer rect at full window size.#290

Merged
RyeMutt merged 1 commit into
developfrom
rye/mouselook-fragmentation
Jun 2, 2026
Merged

Always render world viewer rect at full window size.#290
RyeMutt merged 1 commit into
developfrom
rye/mouselook-fragmentation

Conversation

@RyeMutt
Copy link
Copy Markdown
Member

@RyeMutt RyeMutt commented Jun 1, 2026

Description

Transitions to/from mouselook on extreme resolution displays was resulting in window buffers repeatedly being torn down and recreated.

Related Issues

  • Please link to a relevant GitHub issue for additional context.
    • Bug Fix: Link to an issue that includes reproduction steps and testing guidance.
    • Feature/Enhancement: Link to an issue with a write-up, rationale, and requirements.

Issue Link:


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Transitions to/from mouselook on extreme resolution displays was resulting in window buffers repeatedly being torn down and recreated
@RyeMutt RyeMutt added this to the NEXT milestone Jun 1, 2026
@RyeMutt RyeMutt self-assigned this Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed world view rectangle behavior when UI elements are hidden, improving viewport stability.

Walkthrough

The PR disables the dynamic world view rectangle recalculation in LLViewerWindow::updateWorldViewRect() by wrapping the placeholder-based resizing logic in a #if 0 block, allowing the function to rely on the existing mWindowRectRaw-derived rectangle computation instead.

Changes

World View Rectangle Update

Layer / File(s) Summary
Disable placeholder-driven world view resizing
indra/newview/llviewerwindow.cpp
The dynamic world view rect recalculation from mWorldViewPlaceholder->calcScreenRect() is permanently disabled via #if 0 ... #endif`` preprocessing directives, leaving the existing mWindowRectRaw-based logic active.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

c/cpp, llui

Poem

🐰 A placeholder once danced with the viewport light,
But now it slumbers, wrapped in #if 0 tight,
The raw rectangle takes its ancient stage,
Simpler worlds for a simpler age! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description identifies the problem (buffer torn down/recreated during mouselook transitions on extreme resolution displays) but lacks key details: no linked GitHub issue, no testing confirmation, and no implementation specifics. Link the related GitHub issue for context, confirm local testing was completed, and provide details about how the change prevents buffer fragmentation.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: disabling dynamic world rect recalculation to always use full window size, which directly addresses the mouselook buffer fragmentation issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clang (14.0.6)
indra/newview/llviewerwindow.cpp

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: clang-tidy indra/newview/llviewerwindow.cpp -- -std=c++17 -I./indra -I./scripts -I./indra/newview -I./indra/llcommon -I./indra/llui -I./indra/llmessage -I./indra/llmath -I./indra/llcorehttp -I./indra/llrender -I./indra/llcharacter -I./indra/llinventory -I./indra/llprimitive -I./indra/llappearance -I./indra/llwindow -I./indra/llaudio -I./indra/llappearanceutility -I./indra/llimage -I./indra/test -I./indra/llcorehttp/tests -I./indra/llfilesystem -I./indra/llplugin -I./indra/externals/tut/tut -I./indra/newview/gltf -I./indra/llphysicsextensionsos -I./indra/llxml -I./indra/llmessage/tests -I./indra/externals/mikktspace/mikktspace -I./indra/llkdu -I./indra/llcommon/tests -I./indra/llwebrtc -I./indra/integration_tests/llui_libtest -I./indra/llimagej2coj -I./scripts/templates -I./indra/integration_tests/llimage_libtest -I./indra/llplugin/slplugin -I./in

... [truncated 3695 characters] ...

hared_ptrINS_18CompilerInvocationEES7_INS_22PCHContainerOperationsEE+0x134)[0x7f2949996204]
/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang7tooling14ToolInvocation3runEv+0x57d)[0x7f294999516d]
/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang7tooling9ClangTool3runEPNS0_10ToolActionE+0x10de)[0x7f2949997e2e]
clang-tidy(_ZN5clang4tidy12runClangTidyERNS0_16ClangTidyContextERKNS_7tooling19CompilationDatabaseEN4llvm8ArrayRefINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS7_18IntrusiveRefCntPtrINS7_3vfs17OverlayFileSystemEEEbbNS7_9StringRefE+0x422)[0xbc4dc2]
clang-tidy(_ZN5clang4tidy13clangTidyMainEiPPKc+0x208b)[0x5c231b]
/lib/x86_64-linux-gnu/libc.so.6(+0x2724a)[0x7f294041824a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7f2940418305]
clang-tidy(_start+0x21)[0x5be141]


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
indra/newview/llviewerwindow.cpp (1)

4330-4345: ⚡ Quick win

Remove the disabled dynamic resize branch and the now-unused use_full_window parameter

LLViewerWindow::updateWorldViewRect(bool use_full_window) currently only reads use_full_window inside the #if 0 block, so that parameter is effectively dead. Delete the disabled branch to make the “always full-window” behavior explicit, and then drop use_full_window from the signature and update the two call sites (updateWorldViewRect(world_view_uses_full_window) and updateWorldViewRect(!show_ui)).

♻️ Proposed change in this hunk
-#if 0 // Disable dynamic world view resizing for now since it causes some peformance issues on large displays when entering/leaving
-      // mouselook or hiding UI. We can re-enable this in the future when we have a better solution for the performance issues, such as
-      // rendering to a smaller offscreen buffer and then upscaling to the window size.
-    if (!use_full_window && mWorldViewPlaceholder.get())
-    {
-        new_world_rect = mWorldViewPlaceholder.get()->calcScreenRect();
-        // clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers
-        new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1);
-        new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1);
-
-        new_world_rect.mLeft = ll_round((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]);
-        new_world_rect.mRight = ll_round((F32)new_world_rect.mRight * mDisplayScale.mV[VX]);
-        new_world_rect.mBottom = ll_round((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]);
-        new_world_rect.mTop = ll_round((F32)new_world_rect.mTop * mDisplayScale.mV[VY]);
-    }
-#endif
+    // Intentionally always render world view at full window size.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@indra/newview/llviewerwindow.cpp` around lines 4330 - 4345, Remove the dead
dynamic-resize branch and the unused parameter by deleting the entire disabled
`#if` 0 block inside LLViewerWindow::updateWorldViewRect and then remove the bool
use_full_window parameter from the method signature and any declarations; update
all call sites (e.g., updateWorldViewRect(world_view_uses_full_window) and
updateWorldViewRect(!show_ui)) to call the parameterless
LLViewerWindow::updateWorldViewRect(), and adjust any forward declarations or
overrides to match the new signature so compilation succeeds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@indra/newview/llviewerwindow.cpp`:
- Around line 4330-4345: Remove the dead dynamic-resize branch and the unused
parameter by deleting the entire disabled `#if` 0 block inside
LLViewerWindow::updateWorldViewRect and then remove the bool use_full_window
parameter from the method signature and any declarations; update all call sites
(e.g., updateWorldViewRect(world_view_uses_full_window) and
updateWorldViewRect(!show_ui)) to call the parameterless
LLViewerWindow::updateWorldViewRect(), and adjust any forward declarations or
overrides to match the new signature so compilation succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8a0b98ce-9ea6-4790-a477-f1e34ca36c83

📥 Commits

Reviewing files that changed from the base of the PR and between 477fb7a and 48c2dfb.

📒 Files selected for processing (1)
  • indra/newview/llviewerwindow.cpp

@RyeMutt RyeMutt merged commit 1b8b4f8 into develop Jun 2, 2026
17 checks passed
@RyeMutt RyeMutt deleted the rye/mouselook-fragmentation branch June 2, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant