It could be useful to keep track of some CPU/GPU analytics, like memory usage.
Info already displayed on initialization: GPU vendor, renderer, version, GLSL version
Data loading memory usage:
- CPU: Images / Sounds / MusicStream / Font.chars
- GPU: Textures / Shaders / Meshes / Font.texture
Data loading can be registered with: RL_MALLOC() / RL_CALLOC() / RL_FREE()
enum StatsMemType {
CPU_RAW_DATA,
CPU_VERTEX_DATA,
CPU_IMAGE,
CPU_TEXT,
CPU_FONT_DATA,
CPU_AUDIO_BUFFER,
GPU_VERTEX_BUFFER,
GPU_TEXTURE,
GPU_SHADER,
GPU_FBO
} StatsMemType;
// Global memory usage stats
struct StatsMemAlloc {
int id;
int type; // StatsMemType
unsigned int size; // Size in bytes
} StatsMemAlloc;
#define STATS_MEM_RECORD(int type, int size) StatsMemAlloc(type, size)
- GPU memory allocations (VRAM):
glBufferData(), glTexImage2D(), glShaderSource()
- Frame times:
updateTime, drawTime, idleTime
- Draw calls counter (and batching)
- Textures information (# textures, id, format, samplerState)
This issue is a draft, just some notes. Need to think about the best way to organize/record this information.
typedef struct GpuStats { // 1 frame? General? → FrameStats?
int drawsCount;
int vertexCount;
int trianglesCount;
int texturesCount; // total? used in frame?
int texturesMemory; // in bytes
int vertexMemory; // in bytes, in CPU/GPU?
float timeUpdate; // in seconds
float timeDraw;
float timeIdle;
} GpuStats;
It could be useful to keep track of some CPU/GPU analytics, like memory usage.
Info already displayed on initialization: GPU vendor, renderer, version, GLSL version
Data loading memory usage:
Data loading can be registered with:
RL_MALLOC()/RL_CALLOC()/RL_FREE()glBufferData(),glTexImage2D(),glShaderSource()updateTime,drawTime,idleTimeThis issue is a draft, just some notes. Need to think about the best way to organize/record this information.