mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 15:59:59 -04:00
Every report adds a line for video memory outside VMA (the driver's usage and budget per heap against VMA's blocks, and counts of pipelines by kind and by last use, stage libraries, compute pipelines, layouts and descriptor pools, with the swapchain, DLSS and FSR sizes), a line that splits the process's commit by owner (the game's heap and maps, device-local memory, VMA's host blocks, the C runtime heap with the shader caches, pipeline tables, texture cache, log queue and flight recorder in it, the driver's pipeline cache data and the rest), and a line naming what grew by more than 64 MiB since the report before and since play began. Every ten minutes of play and at exit a ranking line orders the categories by growth and marks those that only climbed; tests/mem_growth_check.py checks that bookkeeping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
846 B
C
12 lines
846 B
C
// Log writes on a thread of their own (logq.c). main.c owns the log's destinations and hands every line here.
|
|
#pragma once
|
|
#include <stddef.h>
|
|
|
|
typedef void (*LogqSink)(const char *p, size_t n); // writes the bytes to the log's destinations; may block
|
|
|
|
void logq_init(LogqSink sink); // before the first logq_write; lines are written by the thread that logs them
|
|
int logq_async(void); // from now on the log thread writes them; 0 when it could not be started
|
|
void logq_write(const char *p, size_t n); // queues the bytes, or writes them when the queue is off or has no room
|
|
void logq_sync(void); // writes what is queued, on the calling thread, and turns the queue off
|
|
size_t logq_bytes(void); // the queue's buffers, for the memory report (vk_memory.c system_log)
|