From f32df38048eaef6a95bcfae2ddc28e15b022cbb1 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Thu, 16 Apr 2026 19:58:38 +0300 Subject: [PATCH] debug: add a new debug flag to log VBO usage --- src/arrays.cpp | 2 ++ src/debug.c | 1 + src/debug.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/arrays.cpp b/src/arrays.cpp index 23bb80b..919f0fc 100644 --- a/src/arrays.cpp +++ b/src/arrays.cpp @@ -794,6 +794,8 @@ OgxArrayReader *_ogx_array_add(uint8_t attribute, const OgxVertexAttribArray *ar /* No conversions needed, just dump the data from the array directly * into the GX pipe. */ if (array->vbo) { + debug(OGX_LOG_VBO, "Using VBO %d for attr %d type %d, n=%d", + array->vbo, info.format.attribute, info.format.size, array->size); new (reader) DirectVboReader(array->vbo, info.format, data, stride); return reader; } diff --git a/src/debug.c b/src/debug.c index bf2447f..e4ccf58 100644 --- a/src/debug.c +++ b/src/debug.c @@ -46,6 +46,7 @@ static const struct { { "texture", OGX_LOG_TEXTURE }, { "stencil", OGX_LOG_STENCIL }, { "shader", OGX_LOG_SHADER }, + { "vbo", OGX_LOG_VBO }, { NULL, 0 }, }; diff --git a/src/debug.h b/src/debug.h index 79f4566..edc4cd5 100644 --- a/src/debug.h +++ b/src/debug.h @@ -44,6 +44,7 @@ typedef enum { OGX_LOG_STENCIL = 1 << 4, OGX_LOG_CLIPPING = 1 << 5, OGX_LOG_SHADER = 1 << 6, + OGX_LOG_VBO = 1 << 7, } OgxLogMask; extern OgxLogMask _ogx_log_mask;