Commit Graph

1632 Commits (79909b8a335b9fdeaefe384528284538e8dae6a4)

Author SHA1 Message Date
Rye 79909b8a33
Fix rendering differences observed in 2025.07 (#4747)
* Fix calling setTextureAddressModeFast and setTextureFilteringOptionFast with invalid tex type during fast binds

* Restore mRT->screen to GL_RGBA16F to fix lighting banding
2025-09-29 09:23:29 -07:00
Rye 452c8e0ea4
Follow up fixes for Apple Silicon (#4662)
* Remove GLM sse flag from cmake that was moved to llpreprocessor.h

* Further reduce performance loss of HDR and Sharpening on bandwith-constrained gpu by combining gamma correction into tonemap/sharpening shader passes

* Update SSE2NEON to 1.8.0 to fix random render nans

* Fix occasional startup crash from LLCachedControl being declared in global scope
2025-09-11 20:54:32 -04:00
Andrey Kleshchev 90aa693f2a
Merge Changes for support of apple silicon on macOS
Mac Arm
2025-09-03 20:30:12 +03:00
Andrey Kleshchev e77eb6b531 #4598 Fix variables being inited before settings are ready 2025-08-29 20:38:43 +03:00
Rye d010e55b88 Tabs to spaces 2025-08-28 06:21:38 -04:00
Rye 24aef9a982 Fix large performance drop when enabling AA on macOS/lower end GPU hardware 2025-08-22 13:12:43 -04:00
Rye f8a0878c78 Fix Apple M GPU crash from nans slipping into the normal buffer by utilizing a non-float format 2025-08-22 12:23:45 -04:00
Rye ba30737d8f Merge branch 'develop' of github.com:secondlife/viewer into rye/infinitemac 2025-08-20 18:04:55 -04:00
Jonathan "Geenz" Goodman 293462d8ff
Merge pull request #3883 from williamweaver/fix/remove-duplicate-render-setting
Fix: Remove potentially redundant RenderAutoHideSurfaceAreaLimit sett…
2025-04-15 13:50:39 -04:00
Jonathan "Geenz" Goodman d19d44cc72
Merge pull request #3911 from secondlife/main
Merge 2025.03 release into develop.
2025-04-15 10:14:27 -04:00
William Weaver cfbcdd713b Fix: Remove potentially redundant RenderAutoHideSurfaceAreaLimit setting registration
This commit removes a seemingly duplicated `connectRefreshCachedSettingsSafe` call in `LLPipeline::init()` for the `RenderAutoHideSurfaceAreaLimit` setting.

A duplicated registration for this setting was identified during a review of `LLPipeline::init()`. Double registration can lead to unexpected behavior, including potential CPU overhead.

The duplication *may* have been introduced with commit 440c7b2 (Added CollectFontVertexBuffers feature), though this requires further confirmation.

Testing Performed:

After removing the duplicate registration, the `RenderAutoHideSurfaceAreaLimit` functionality was validated by ensuring the following behavior (consistent with the existing code):

* A value of 0 (zero) causes all objects to appear regardless of size.
* Values slightly above zero result in only small objects appearing, with all others hidden.
* Increasing the value causes objects of increasing size to appear, while smaller objects remain visible.

This change merits careful review to ensure it has no unintended side effects, and to confirm the accuracy of these observations from other developers.
2025-04-07 16:57:12 +03:00
William Weaver e1ebb33ab2 fix(pipeline): Remove incorrect zeroing of mRT dimensions in createGLBuffers
Resolves the root cause of shadow rendering failures when changing RenderShadowResolutionScale immediately after modifying other graphics settings (e.g., SSAO, HDR).

Investigation revealed that LLPipeline::createGLBuffers, which is called during certain graphics setting changes that require full buffer recreation, contained lines that incorrectly set mRT->width and mRT->height to zero *after* the call to allocateScreenBuffer had already established the correct dimensions.

This created a state inconsistency. If RenderShadowResolutionScale was changed immediately following the graphics setting change, the subsequent call to LLPipeline::resizeShadowTexture (triggered via handleShadowsResized) would read these incorrect zero dimensions from mRT. This led to failed shadow buffer allocation (allocateShadowBuffer(0, 0)) and resulted in corrupted or missing shadows.

This commit removes the erroneous mRT->width = 0 and mRT->height = 0 lines from the end of createGLBuffers. This ensures that the render target dimensions remain valid after buffer recreation.

With this fix, resizeShadowTexture now correctly reads the valid screen dimensions immediately following a graphics setting change and successfully resizes the shadow buffers without delay or error. This eliminates the need for previous workarounds like guard conditions or forced shader recompiles.

Ref: #3719
2025-03-28 04:28:36 +03:00
William Weaver 76db64e0c8 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.
2025-03-12 19:52:56 +03:00
Jonathan "Geenz" Goodman e0d14e02e1 Merge branch 'release/2025.03' into rye/forevermac 2025-03-11 22:44:49 -04:00
Andrey Kleshchev 4214ab8e79 #3280 Fix crashes at gFloaterTools
Likely specific to headless client
2025-02-28 00:02:02 +02:00
Andrey Kleshchev ecac92c60c #3627 Warn user about low memory on bad_alloc 2025-02-27 17:43:16 +02:00
Rye fd94dc0cd0 Disable old GPU hacks on macos when running against Apple GPU 2025-02-11 05:04:10 -05:00
Rye 6fcd349f37 Fix Tracy memory profiling overloads for aligned allocations
Fix disabling renderdoc support
Improve ll_aligned_alloc functions on darwin for 32 and 64byte aligned by utilizing posix_memalign
2025-02-11 05:04:05 -05:00
Jonathan "Geenz" Goodman 93a88e6025
Water Exclusion Surfaces (#3517)
* #3455 Add support for water exclusion surfaces
2025-02-07 05:55:47 -05:00
Rye 4763195e18 Fix potential undefined behavior when converting to and from glm types from LLVector3/4 and fall back mul_mat4_vec3 to scalar implementation to attempt crash mitigation (#3339) 2025-01-23 18:40:19 -05:00
Maxim Nikolenko f490bf6463
#3442 Crash at LLDrawable::isState 2025-01-21 16:25:01 +02:00
Andrey Kleshchev a27515748f #3311 RenderSkyAutoAdjustLegacy does not engage tonemapper 2025-01-02 20:55:17 +02:00
Rye d17fd56dc4 Fix crashes from shader load failures under RenderMaxOpenGLVersion 3.1/3.2/3.3 (#3184) 2024-12-10 17:24:39 -08:00
Andrey Kleshchev 97826b555b viewer#3169 Legacy settings should no longer be automatically converted 2024-12-10 21:05:41 +02:00
Dave Parks 5e35785b8d
#3219 Revert default exposure thresholds to DeltaFPS values (#3228) 2024-12-06 13:42:48 -06:00
Andrey Kleshchev 396b97aebf viewer-private#330 Fix LLCachedControl for vintage 2024-12-05 18:59:59 +02:00
Jonathan "Geenz" Goodman 3001280141
Additional tweaks to get skies closer to 6.6.17 in classic mode. (#3202) 2024-12-03 18:01:37 -05:00
Jonathan "Geenz" Goodman c02baded84
#3170 Fix for tonemapping not working with PBR skies. 2024-11-28 17:57:30 -05:00
Andrey Kleshchev 1b4814f0e5 viewer#3170 Fix tonemaping slider
At the moment slider is in general settings, not per environment
2024-11-29 00:12:27 +02:00
Jonathan "Geenz" Goodman d65fb7cec8
Drop emissive on old Intel GPUs (#3110)
* #3103 Add the ability to disable the emissive buffer for older GPUs with low memory bandwidth.
* #3135 Add a "vintage" mode for slower GPUs
* #2719 Fix for skies being overbrightened
* #2632 Do not apply tonemapping on legacy skies
2024-11-25 20:56:03 -05:00
Brad Linden 7be9c43f28
brad/2744 handle shader errors (#3105)
* Partial solution to secondlife/viewer#2744 crash with better error handling.

Handles shader compile errors better, and should turn crash into an LL_ERRS assertion failure.
Strengthed more assertions and improved shader error line numbers

* Even more error handling to get a handle on crash secondlife/viewer#2744
* Improved GLSL correctness on Intel chips that lack OpenGL 4.6 support. secondlife/viewer#2744
* Removed non-working fallback code for gDeferredPostProgram
* Fixed incorrect llmax call
2024-11-19 10:49:09 -08:00
Dave Parks 2b255535ef
2590 mac intel and radeon pro 5300m horrible fps 2 (#3030)
* OpenGL 3.3 compatibility pass.  Fix for FBO driven downscaling corrupting textures.
* Increase maximum texture bias, immediately scale down when textures are loaded higher resolution than desired
* #2590 Fix for some frame stalls on Intel Macs
2024-11-12 15:26:38 -08:00
Brad Linden b4b52e4717
Add early-out in LLPipeline::applyCAS() if gCASProgram failed to compile. (#2760)
fix secondlife/viewer#2756
2024-10-01 16:04:44 -07:00
Andrey Kleshchev 440c7b20da #2411 Allow disabling and enabling LLFontVertexBuffer
for testing purposes
2024-09-26 20:56:45 +03:00
Brad Linden 5eab135892
Fix sky settings with reflection probe ambiance of 0 still receiving tonemapping (#2659)
Co-authored-by: Rye Cogtail <rye@lindenlab.com>
2024-09-23 15:19:55 -07:00
Ansariel Hiller d9da5bbb33
Remove quads rendering mode entirely (#2593) 2024-09-18 17:09:51 +03:00
Dave Parks 870ffbd55b
Suppress mapBuffer warnings. (#2584) 2024-09-17 12:43:47 -05:00
Rye Mutt 42975dfd88
Merge pull request #2580 from RyeMutt/2kbom
Raise resolution of local baked texture preview from 512 to 2048
2024-09-16 16:46:14 -07:00
Rye Mutt eac0c748a2
Fix noise post effect due to missing uniform (#2581) 2024-09-16 17:59:34 -05:00
Rye Cogtail 85a7020e49 Raise resolution of local baked texture preview from 512 to 2048 2024-09-16 15:12:15 -04:00
Rye Mutt b713f56d07
Replace glh_linear usage with GLM (#2554) 2024-09-12 11:22:10 -05:00
Alexander Gavriliuk ce23e4a0c3 #2460 Max-Non-Impostors uses a bad shape (code formatting) 2024-09-10 23:11:33 +02:00
Ansariel 761a4fa429 Clean up llviewermenu 2024-09-10 13:54:38 +02:00
Rye Cogtail dfae0d9d78 Fix visualizing luminance buffer and small cleanup 2024-09-03 18:20:36 -04:00
Rye Mutt 5b832291a8
Introduce Khronos Neutral tonemapper as new default along with debug options to control tonemap mix (#2464) (#2468) 2024-08-30 14:49:05 -05:00
Rye Mutt 958afaa7a7 Integrate SMAA and rework post process chain for better visual quality
Add SMAA buffer generation passes
Add quality levels for both FXAA and SMAA
Separate gamma correction and tonemapping for effects that require linear-but-tonemapped inputs
Move application of noise to final render pass to screen to avoid damaging other post process effects
2024-08-29 17:24:50 -04:00
Rye Mutt 8759edd575 Fix SSR clamping hdr brightness ranges 2024-08-29 16:32:15 -04:00
Andrey Kleshchev e2809755c5 Make LLPipeline::renderDebug() a bit cheaper
Each frame renderDebug() was pointlesly going over a large list of
partitions and bridges.
2024-08-29 21:34:43 +03:00
Rye Mutt ca115671d6 Replaced refreshCachedSetting for sharpening with cached control 2024-08-26 15:42:57 -04:00
Rye Mutt cbca178256 Add Contrast Adaptive Sharpening post process effect(#2399) 2024-08-24 00:55:32 -04:00