| 45 | } |
| 46 | |
| 47 | TextBankGL33::TextBankGL33(EngineGL33* engine) : _totalAllocated(0) |
| 48 | { |
| 49 | _reserveTextureMemory = 0; |
| 50 | _engine = engine; |
| 51 | |
| 52 | CheckTextureMemory(); |
| 53 | |
| 54 | _maxTextureMemory = FreeTextureMemory(); |
| 55 | |
| 56 | // Small texture limit: use ~1/8 of texture memory for small textures |
| 57 | int limitPixels = _limitAllocatedTextures / (2 * 1024 * 8); |
| 58 | int limitPixelsPow2 = 1; |
| 59 | while (limitPixelsPow2 + limitPixelsPow2 < limitPixels) |
| 60 | { |
| 61 | limitPixelsPow2 += limitPixelsPow2; |
| 62 | } |
| 63 | |
| 64 | _maxSmallTexturePixels = limitPixelsPow2; |
| 65 | saturateMax(_maxSmallTexturePixels, 4 * 4); |
| 66 | LOG_DEBUG(Graphics, "GL33 Max small texture pixels: {}, {:.0f}", _maxSmallTexturePixels, |
| 67 | sqrt(_maxSmallTexturePixels)); |
| 68 | |
| 69 | // Surface texture residency in the memory-budget panel. Textures are the |
| 70 | // largest consumer; _totalAllocated is live GPU bytes, _maxTextureMemory the |
| 71 | // detected VRAM budget. Observability only — no Free hook (see header). |
| 72 | _memProbe.Register( |
| 73 | "Textures", 0.5f, [this] { return (size_t)_totalAllocated; }, [this] { return (size_t)_maxTextureMemory; }, |
| 74 | [this] { return (size_t)_texture.Size(); }); |
| 75 | } |
| 76 | |
| 77 | TextBankGL33::~TextBankGL33() |
| 78 | { |
nothing calls this directly
no test coverage detected