6.2 VRAM Allocation
For textures and render buffers: - Use KOS’s
pvr_mem_malloc/pvr_mem_free - Align
allocations to PVR2 requirements (8-byte alignment) - Track VRAM usage
separately
void *d3tui_vram_malloc(size_t size) {
// PVR2 requires 8-byte alignment
size = (size + 7) & ~7;
void *ptr = pvr_mem_malloc(size);
if (ptr) {
memory_manager.vram_usage += size;
}
return ptr;
}