summaryrefslogtreecommitdiff
path: root/doc/sl-logo.png
diff options
context:
space:
mode:
authorWilliam Weaver <paperwork.resident@gmail.com>2025-03-12 19:52:56 +0300
committerWilliam Weaver <paperwork.resident@gmail.com>2025-03-12 19:52:56 +0300
commit76db64e0c8c7dd40ce2a85ef19183c3c245f1dc8 (patch)
treec73ce383b783be191407df33eca8bc59996cc577 /doc/sl-logo.png
parent942527ddf39925e3e77d5c4e30a0fdc245156ada (diff)
Fixes: Add guard to prevent shadow texture resize with invalid mRT dimensions after shader changes; **Replaces forced shader refresh with lightweight guard**
This commit introduces a guard in `LLPipeline::resizeShadowTexture()` to prevent shadow texture resizing when the shadow render target (mRT) has invalid (zero) dimensions. **This replaces a previous, less efficient approach of forcing a full shader recompile whenever `RenderShadowResolutionScale` was changed in-session.** **Background and Problem:** Previously, the code forced a full shader recompile whenever `RenderShadowResolutionScale` changed in-session (after toggling advanced graphics settings like SSAO or HDR). While this “sledgehammer” approach did fix broken shadow rendering, it unnecessarily thrashed the shader cache and reset many pipeline states. **Solution:** This commit removes the forced shader recompile in favor of a guard check in `LLPipeline::resizeShadowTexture()`. The guard ensures mRT (the shadow render target) has non-zero dimensions before resizing. If mRT is zero for that frame, the resize operation is skipped, and a warning is logged. Once mRT becomes valid (usually in the next frame), the shadow texture is resized successfully without requiring a full shader refresh. **Detailed changes:** - Reverted the binding of `RenderShadowResolutionScale` to `handleSetShaderChanged`. - Restored the original `handleShadowsResized` listener for `RenderShadowResolutionScale` in `llviewercontrol.cpp`. - Added guard checks in `LLPipeline::resizeShadowTexture()` to skip resizing when `mRT->width` or `mRT->height` is zero. - Added logging statements to track how many frames are skipped. **Benefits:** - Prevents shader thrashing while still avoiding shadow corruption. - Shadows now update correctly as soon as mRT dimensions are valid. - Maintains a detailed record of frames skipped. - **Lightweight and targeted interim solution, much less disruptive than a full shader recompile.** Testing: 1. Reproduce the bug as described in the bug report (toggle SSAO, then change RenderShadowResolutionScale). 2. Verify that shadows are no longer broken after these steps. 3. Check the logs for the warning message indicating skipped frames when the bug is triggered. 4. Confirm that under normal operation (without shader changes causing mRT issues), shadow resizing works as expected without excessive warnings. Documentation: No user-facing documentation changes are needed for this interim fix. However, internal developer documentation should note this guard and the ongoing investigation into the root cause. Further Development: This guard is a temporary fix. The root cause of why mRT becomes invalid after shader changes needs to be investigated and resolved. See the bug report for detailed next steps for investigation.
Diffstat (limited to 'doc/sl-logo.png')
0 files changed, 0 insertions, 0 deletions