FVramPressureGovernor
Turns the driver's VRAM budget into a cap on a streaming pool (one governor per pool: textures, mesh LODs). The configured pool is a guess made at startup (half the card); the budget the OS grants shrinks when another process takes VRAM, and a pool that keeps asking for its full size past that point pages the whole process out of local memory. Over the high mark the cap drops to the resident streaming bytes minus this pool's share of the overshoot, so the farthest textures or least recently seen meshes coarsen first; under the low mark it relaxes by a quarter of the headroom per update and lifts entirely once it no longer constrains anything. Pools that share one budget split the overshoot by their resident bytes (SharedOvershoot): each taking the whole of it would evict twice what the budget needs.
- Module
- Game
- Header
#include "Streaming/VramPressureGovernor.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr double | kHighMark | Default 0.95. |
static constexpr double | kTargetMark | Default 0.90. |
static constexpr double | kLowMark | Default 0.85. |
static constexpr uint64_t | kFloorBytes | Never squeeze the pool below this: past it the streamer is down to tail mips and the overshoot belongs to someone else. Default 64ull << 20. |
Public functions
| Returns | Name | Description |
|---|---|---|
FGpuMemoryStats | WithForcedBudget | The driver's sample with the OS budget replaced by forcedBudgetBytes (0 keeps the live one): r.TextureStreaming.ForceBudgetMB, which makes a large card behave as a small one so the pressure path can be watched and tested on any machine. |
double | SharedOvershoot | This pool's share of an overshoot that several pools answer together. |
uint64_t | Update | The pool to apply this update (0 = unlimited, as the cvar means it). |
bool | IsCapping | |
uint64_t | GetCapBytes | |
uint64_t | Apply | The configured pool under the cap this governor last decided, for the ticks between two driver samples. |
uint32_t | GetPressureUpdates |
Function details
WithForcedBudget
static FGpuMemoryStats WithForcedBudget(const FGpuMemoryStats& live, uint64_t forcedBudgetBytes)The driver's sample with the OS budget replaced by forcedBudgetBytes (0 keeps the live one): r.TextureStreaming.ForceBudgetMB, which makes a large card behave as a small one so the pressure path can be watched and tested on any machine. Usage stays live.
SharedOvershoot
static double SharedOvershoot(uint64_t poolResidentBytes, uint64_t allPoolsResidentBytes)This pool's share of an overshoot that several pools answer together.
Update
uint64_t Update(uint64_t configuredBytes, uint64_t streamingResidentBytes, const FGpuMemoryStats& stats, double overshootShare = 1.0)The pool to apply this update (0 = unlimited, as the cvar means it).
IsCapping
bool IsCapping() constGetCapBytes
uint64_t GetCapBytes() constApply
uint64_t Apply(uint64_t configuredBytes) constThe configured pool under the cap this governor last decided, for the ticks between two driver samples.
GetPressureUpdates
uint32_t GetPressureUpdates() const