]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Optimize parallax VRAM usage (#37180)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Thu, 22 May 2025 01:22:08 +0000 (03:22 +0200)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 01:22:08 +0000 (11:22 +1000)
commit1d5a06612aa0bfd5e6943801a419c116e015e47c
treed442e47dabd1be116def1684a68ebdf74f356141
parent6f89c2c455e23f78a6159252f8e06031d8600b44
Optimize parallax VRAM usage (#37180)

* Disable parallax texture preloading

Many parallax layers are specific to a single map and will likely never be loaded for the duration of the game. Save VRAM by not loading them always.

Requires engine master

* Put generated parallax identifier in texture name

Makes it show up properly in debugging tools

* Don't load generated parallaxes multiple times

Many parallax prototypes re-use the same generated parallax configs. These generated parallaxes were being loaded multiple times at once, which was a massive waste of VRAM.

We now move these into a separate cache for deduplication. I had to write a lot of logic to handle loading cancellation and ref counting. Yay.

Also fixes some spaghetti with the previous parallax loading system: cancellation didn't work properly, give proper names to generated texture names, etc.

This saves like 100+ MB of VRAM.
19 files changed:
Content.Client/IoC/ClientContentIoC.cs
Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs
Content.Client/Parallax/Data/IParallaxTextureSource.cs
Content.Client/Parallax/Managers/GeneratedParallaxCache.cs [new file with mode: 0644]
Content.Client/Parallax/Managers/ParallaxManager.cs
Resources/Textures/Parallaxes/AspidParallaxBG.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/AspidParallaxNeb.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/Asteroids.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/KettleParallaxBG.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/KettleParallaxNeb.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/core_planet.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/debris_large.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/debris_small.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/gas_giant.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/land.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/layer1.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/noise.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/planet.png.yml [new file with mode: 0644]
Resources/Textures/Parallaxes/space_map2.png.yml [new file with mode: 0644]