feat(render): unify physical residency accounting

This commit is contained in:
Erik 2026-07-24 16:20:48 +02:00
parent 1866ea0c6d
commit 3e18fc2730
25 changed files with 642 additions and 48 deletions

View file

@ -119,6 +119,12 @@ public interface IPreparedAssetSource : IDisposable
PreparedAssetSourceStats Stats { get; }
CacheStats DecodedTextureCacheStats { get; }
/// <summary>
/// Immutable package address-space mapped by this source. This is virtual
/// address space, not committed managed or process-working-set bytes.
/// </summary>
long MappedVirtualBytes => 0;
}
internal static class PreparedAssetRequestContract
@ -211,6 +217,8 @@ public sealed class PakPreparedAssetSource : IPreparedAssetSource
public CacheStats DecodedTextureCacheStats => default;
public long MappedVirtualBytes => _reader.FileLength;
public PreparedAssetPresence Probe(
PakAssetType type,
uint sourceFileId)

View file

@ -46,6 +46,7 @@ public sealed class PakReader : IDisposable {
private readonly ConcurrentDictionary<int, bool> _loggedCorruption = new();
public PakHeader Header { get; }
public long FileLength => _fileLength;
public PakReader(string path) {
_fileLength = new FileInfo(path).Length;