Skip pre-baked atlas variants the gpu shaders already cover - #88720
Merged
Maleclypse merged 6 commits intoSep 19, 2026
Merged
Conversation
dobbry-vechur
force-pushed
the
feat/atlas-bake-plan
branch
from
September 19, 2026 02:43
b7f9557 to
4139131
Compare
- added compute_atlas_bake_plan and bake_plan_summary - added classify_bundle and bundle_needs_repair - added tiles gpu unit tests for both
- added probe_state and variant_pass::ensure_probed - added sticky shader_fault_ and boundary_lost_ flags - flush and try_begin refuse while the boundary is lost - selected the memory preset when the pass is created - added probe, flush and bind-failure test seams and tests
- added bake plan and filter fingerprint to tileset - upload_atlases takes a fingerprint and a bake plan - skipped variants get empty candidate vectors - added shader_boundary_lost to atlas_upload_interrupt - handled shader_boundary_lost at all three dispatch sites
…play - added apply_tile_atlas_options and on_tiles_options_changed - the replay uploads under the applied configuration and re-keys - added a present gate that refuses frames until repair - the scale default follows SCALING_MODE on save - dropped the restart note from the MEMORY_MAP_MODE help text
- added resolve_atlas_bake_plan - tileset load, replay and synthetic install use the resolver - an unsafe probe aborts the upload with shader_boundary_lost - a sticky shader fault forces a full bake - added a shader availability override test seam and tests
- added an atlas upload log line and GetGPUBackendName - documented the runtime shader switches
dobbry-vechur
force-pushed
the
feat/atlas-bake-plan
branch
from
September 19, 2026 12:00
4139131 to
f14b02f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Performance "Use less VRAM on the gpu renderer by not pre-baking atlas variants the shaders draw"
Purpose of change
Every tileset atlas is uploaded 6 times. On the
gpurenderer sprite shaders already draw shadow, night vision, overexposed, memory from normal atlas, so those 4 copies just sit in VRAM. #87787 and #88270 are VRAM running out on D3D12 and Vulkan.Describe the solution
Each upload now picks which variants to bake. With the shader path live it bakes normal and silhouette, plus memory for the custom overlay (no shader). Other renderers bake all six, same as before.
Upload first probes shaders. Probe/bind failure leaves a sticky fault, and every subsequent upload bakes all six.
Skipped tilesets go stale when shaders are gone or memory overlay switches to custom. Tilesets record what they were baked with, and the present gate holds frames until recovery replay rebakes them.
Saved memory map overlay and scaling mode changes are now done via that replay, so no need to restart the custom overlay anymore.
CATA_FORCE_ATLAS_VARIANTS=1bakes all six anyway,CATA_DISABLE_SPRITE_SHADERS=1turns sprite shaders off. Added some logging for this process.Describe alternatives you've considered
Dropping the baked variants for good. The opengl, direct3d and software renderers still draw from them, and Android can pick software.
Testing
Loaded a save with ultica on local nvidia dgpu, several runs in each direction. VRAM usage dropped from 654 MiB to ~240 MiB. Atlas upload time dropped from ~1.45 s to 0.84 s.
New unit tests cover bake plan, probe states, options repair and recovery paths.
Additional context
N/A