Repository navigation
Conversation
The game's heap (3120 MB) and the limits HD texture packs run past grow with the setting, off by default: the root heap, the models' texture pool (500 MB), ForResourceL and StarterPackMgr (the resident packs), FixedHeap and TexArcWork. Each size comes from the runtime (runtime/kernel.c), the game's own without the setting. The guest window holds a heap of up to 6144 MB; past the device's storage buffer limit the shaders read it in two bindings or by address. SAVAGEWIND_GAME_MEMORY_MB overrides the setting for one run.
Zarigis
marked this pull request as ready for review
November 26, 2026 01:48
This was referenced Nov 26, 2026
Revivedx
added a commit
that referenced
this pull request
Nov 26, 2026
… on light ground, texture filtering - Mods > HD texture packs > More memory for HD textures (#1135, Zarigis): game_memory_mb gives the game 6144 MB instead of its own 3120, and grows its resource heaps and texture pool, so big HD texture packs load. Off by default (checked: the 3120 MB heap and the same RAM as before); on, about 3 GB more RAM, and the shaders read a heap past 4 GB by address. The switch is locked off under 12 GB of RAM. SAVAGEWIND_GAME_MEMORY_MB sets it for one run. - The world map's terrain capture follows the window's height (#1137, Zarigis): at 4K it was the 1080p picture stretched 2x. - Collectible hints stand out on light ground (#1131, Quorthon13): a small copy of the game image, read back a few times a second while the hints show, tells each circle how light the ground is. - The texture memo follows sampler registration (#1118, Dathinel): a filter the game replaced within a frame could stay on a later draw. - Tegra copies take full 64-byte GOB rows as four fixed sector copies (#1129, Dathinel). - Render context 1/7: the pass in progress is one struct, ExecPass ps (#1139, Dathinel). - A keyboard regression test for #1103 (#1119, Dathinel). - The cascade-cut launch flag described on the start screen, and a CI job that keeps the launch flag table in sync (#1128, FictionHub). Measured on a Ryzen 5 5600X + RTX 3060 at 1080p, Original preset (busy PC, 4 runs each): the runtime changes move fps by -3 to +5 % per route, within the noise. Co-authored-by: Dathinel <221246794+Dathinel@users.noreply.github.com> Co-authored-by: Zarigis <2862464+Zarigis@users.noreply.github.com> Co-authored-by: Quorthon13 <44161862+Quorthon13@users.noreply.github.com> Co-authored-by: FictionHub <294548785+FictionHub@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Integrated in |
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.
Adds
game_memory_mb, a setting that gives the game more memory so HD texture packs load. The HDPacks.com 4K pack is the one tested. Off by default: with it unset (0), the game keeps its own 3120 MB heap and nothing changes.Set it in
savagewind.ini(game_memory_mb = 6144), or for one run withSAVAGEWIND_GAME_MEMORY_MB, for example from a launcher that starts the game with a pack. It goes up to 6144 MB. There is no menu entry yet.What this changes
The 4K pack's textures don't fit in the game's fixed memory. Without this, the pack (converted for 1.9.0) crashes at the title screen. With the 4K terrain left out, it loads, but shrine walls and floors are missing.
With
game_memory_mbset, the game is given a bigger heap. The resource heaps and the texture pool that the pack overflows are grown from the extra memory. The Vulkan backend can then see the larger heap.How it works
Guest patches (
tools/game_sites.py,tools/patches.py; all sites are optional groups, with known 1.9.0 addresses):nninitStartupasksSetMemoryHeapSizefor (0xC3000000), and the root heap's size: the heap less the 32 MB that malloc keeps.cselpicks.Pack/TitleBG.packalone grows from 80 to 287 MB with the 4K terrain. ForResourceS is left as it is.Runtime:
runtime/kernel.c:kernel_memory_setupruns once at start, before the renderer. It works out the heap andg_heap_max(the heap plus the same room the game's own has, rounded to 16 MB), and the extra memory each patched heap gets: the root heap is the heap less malloc's 32 MB; texture pool +min(extra × 2/3, 2 GB); ForResourceL and StarterPackMgr each +min(extra / 6, 512 MB); FixedHeap and TexArcWork each +min(extra / 4, 256 MB).GetInfo6/21 report the larger total.runtime/rt.h:HEAP_MAXbecomes the variableg_heap_max.HEAP_MAX_CONSOLE(3.25 GB) andHEAP_MAX_LARGEST(6.25 GB) size what has to be fixed at build time.GUEST_HImoves up to make room; only what the game maps is committed.runtime/nvn/vulkan/exec.c: a heap bigger than the game's own and pastmaxStorageBufferRange(4095 MB on NVIDIA) is read through two bindings. Where even the second binding would be past the limit, it uses buffer device address. Static arrays sized by the heap useHEAP_MAX_LARGEST.runtime/platform/windows.c: the sparse heap's bitmap covers the largest heap.runtime/settings.*,runtime/main.c: the setting and the environment override. The setting is written to the ini only when it's set.With the option unset,
g_heap_maxis the oldHEAP_MAX, every patch writes the game's own value, and the Vulkan setup takes the same path as before.How it was tested
Windows 11, RTX 4080 SUPER, NVIDIA 617.42, 3840×2160, game 1.9.0 with both DLC, on
testat 2a51d02.0x38)game_memory_mb = 6144Details, and what wasn't measured
Pack/Bootup.packand its own ResourceSizeTable, and as distributed it crashes on 1.9.0 whatever the memory. The converter is a separate PR. The runs here used a converted overlay holding only the pack's textures, its 4K terrain and its fonts.[kernel] game memory: 6144 MB heap (the game's own: 3120 MB), limit 6352 MB,ForResourceL 694 MB -> 1198 MB,StarterPackMgr 225 MB -> 729 MB.[vk] t=lines while standing in the world on the Great Plateau, with a scripted load of the same save.main, the same patch was checked by hand: the Shrine of Resurrection, the Great Plateau, Hyrule Castle (inside), Zora's Domain and Gerudo Town, with the 4K pack and its terrain at 6 GB.testbuild these runs came from also had two runtime-only commits for the world map (separate PRs). Neither touches memory or the patches.Checklist
testand opened againsttest