Skip to content

fix: fix water blending and vram texture leak#2490

Merged
SkrubbySkrubInAShrub merged 1 commit into
devfrom
water-fix-dumb
Jun 8, 2026
Merged

fix: fix water blending and vram texture leak#2490
SkrubbySkrubInAShrub merged 1 commit into
devfrom
water-fix-dumb

Conversation

@doodlum

@doodlum doodlum commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved graphics resource management and cleanup for water rendering systems
    • Enhanced temporal anti-aliasing buffer allocation for water effects
  • Refactor

    • Consolidated water rendering target setup logic into core initialization

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f75a1bea-2d8d-4f12-9d02-4f7725a1e0ea

📥 Commits

Reviewing files that changed from the base of the PR and between b0804ab and 7872f6e.

📒 Files selected for processing (2)
  • src/Deferred.cpp
  • src/Hooks.cpp
💤 Files with no reviewable changes (1)
  • src/Hooks.cpp

📝 Walkthrough

Walkthrough

The PR migrates TAA water history render target creation from hook-based format overrides to explicit setup in Deferred.cpp, adding resource cleanup to prevent COM pointer leaks and removing corresponding hook implementations.

Changes

Water History Render Target Migration

Layer / File(s) Summary
Render target cleanup and water history allocation
src/Deferred.cpp
SetupRenderTarget adds cleanup to release stale COM pointers (UAV, RTV, SRV, textures) before creating new render targets. Deferred::SetupResources allocates kWATER_1 and kWATER_2 render targets with DXGI_FORMAT_R16G16B16A16_FLOAT and render-target + shader-resource binding for TAA water blending.
Remove hook-based water render target overrides
src/Hooks.cpp
Removes the CreateRenderTarget_Water1 and CreateRenderTarget_Water2 hook struct definitions and their registrations in Hooks::Install() since water target format configuration is now handled directly in Deferred::SetupResources.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • jiayev
  • davo0411

🐰 A tale of two targets, once forced by hooks so grand,
Now settled in Deferred with cleanup so planned,
Water flows cleaner when resources align,
TAA history shines with RGBA16 design!
No more stale pointers to haunt the GPU's mind.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically addresses both main changes: fixing water blending (TAA history buffers setup) and fixing VRAM texture leak (explicit resource cleanup).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch water-fix-dumb

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.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.13][ERROR]: Error: exception Unix_error: No such file or directory stat src/Deferred.cpp
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called from Scan_CLI.re

🔧 Infer (1.2.0)
src/Deferred.cpp

Usage Error: Failed to execute compilation command:
'/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/clang/install/bin/clang++'
-c src/Deferred.cpp -o /tmp/coderabbit-infer/9aac6da5ffddefdc/file.o

Error message:
clang++: error: no such file or directory: 'src/Deferred.cpp'

*** Infer needs a working compilation command to run.


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.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

No actionable suggestions for changed features.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub merged commit 080afc0 into dev Jun 8, 2026
15 checks passed
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub deleted the water-fix-dumb branch June 8, 2026 20:39
alandtse added a commit to alandtse/open-shaders that referenced this pull request Jun 8, 2026
 resolution

The water-RT move rationale lives in the community-shaders#2490 commit message; per CLAUDE.md
comments describe present code, not removed code. The surviving Precip/
Reflections hooks carry the fork's VR offset like every other hook in the block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alandtse added a commit to alandtse/open-shaders that referenced this pull request Jun 9, 2026
Adopts the 3 upstream Community Shaders dev fixes landed since v1.7.0-rc.1:
- community-shaders#2488 water-caustics X4000 warnings
- community-shaders#2487 alt-tab CTD with no cursor png (fork ships none)
- community-shaders#2490 water blending + VRAM texture leak (Water RT format-forcing moved to
  Deferred::SetupResources; keep-VR: Water hooks' VR offsets retire with them,
  Precip/Reflections keep theirs)

Merged (not cherry-picked) to preserve upstream commit ancestry for clean
future syncs.

# Conflicts:
#	src/Hooks.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants