Skip to content

Stop uploading unused per-sprite and duplicate atlas textures (#110) - #121

Open
nvzkupu wants to merge 2 commits into
mainfrom
devin/1795475408-drop-unused-sprite-uploads
Open

nvzkupu wants to merge 2 commits into
mainfrom
devin/1795475408-drop-unused-sprite-uploads

Conversation

@nvzkupu

@nvzkupu nvzkupu commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mod-side half of #110. On every atlas capture BlockTextureManager uploaded GPU textures that nothing samples. A resource reload destroys and re-uploads them, and the runtime keeps destroyed textures in its cache, so each reload left more memory behind.

What this PR removes:

  • The duplicate atlas albedo. captureAtlas() uploaded block_atlas, and buildAtlasMaterials() then replaced atlasAlbedo with atlas_albedo (after the atlas edits). Only the second upload is kept.
  • The per-sprite textures (s<i>_a, _n, _h, _r, _m, _s, _ssa, _e). Only the lazy getMaterial(SpriteEntry, int) path read them, and nothing in the repo calls it: terrain uses the atlas-level materials. That path is removed along with its materials cache and forgetCachedCutoutSpriteMaterials().

buildPBR becomes scanPBR. It still computes the facts other code reads from each sprite (hasSSS, and lightColor from the emissive channel), but uploads nothing. The atlas-level PBR, SSS and emissive textures are unchanged. The AGENTS.md Textures section is updated to match.

The runtime-side cache retention described in #110 still has to be fixed in dxvk-remix. This PR only stops the mod from feeding that cache.

Verification

  • Linux, outside Gradle: compiled renderer-core/src and rtxremix-java/src with javac 21 and ran the renderer-core/test suite through the JUnit console. 358 of 362 tests passed. The same 4 tests also fail on main in that setup: CanonicalCaptureSemanticsTest needs fixtures from versions/.../test/resources, and DirectoryRuntimePayloadTest depends on Windows file locking.
  • A full Gradle build couldn't run locally because the Fabric, Forge and Mojang Maven hosts aren't reachable from the dev box. Windows CI is the full check.
  • Not measured in-game: VRAM before and after F3+T.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/b86e22769ec7473c926a194b84efd244
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/b86e22769ec7473c926a194b84efd244?variant=devin
Requested by: @nvzkupu


👀 Devin fixed 1 finding · 1 finding for you to triage · Follow Devin's work

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 findings. Devin fixed 1 finding; 1 finding is left for you to triage below.

Fixed by Devin (1)
  • Unused sprite index after cache removal — Removed SpriteEntry.index and its counter; nothing reads it after the per-sprite material cache removal.

View findings in Devin Review · Follow Devin's work

Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Atlas reload lacks live verification

The live rendering check is missing from the PR. Repeat F3+T in game to check animated terrain and measure VRAM across reloads.

Devin left this for you to triage: The in-game check (F3+T repeated, animated terrain, VRAM per reload) needs Windows + an RTX GPU, which Devin's Linux VM doesn't have. Recommend the author run tools\rtx.bat launch and note before/after VRAM and visuals in the PR before merging.

(Refers to this code)

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant