feat(render3d): R3D_DRAWSTATS - every draw a frame makes, by pass, program and kind

Measurement only: a tally at each of gpu.ludic's five draw doors, program
changes and texture binds, keyed by the open profiler pass. Off unless
R3D_DRAWSTATS is set; frames byte-identical with it off and on (Mac, OpenGL).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-15 14:38:30 +03:00
parent 5b28063b52
commit b9eda646fc
4 changed files with 215 additions and 1 deletions

View file

@ -54,6 +54,7 @@ function prof_slot(name: pointer) -> int {
}
function prof_begin(name: pointer) -> void {
ds_set_pass(name)
if not prof_on { return }
if prof_active >= 0 { return } # GL_TIME_ELAPSED queries cannot nest
let s = prof_slot(name)
@ -63,6 +64,7 @@ function prof_begin(name: pointer) -> void {
}
function prof_end() -> void {
ds_set_pass(ds_outside)
if not prof_on { return }
if prof_active < 0 { return }
gpu_query_end()
@ -241,6 +243,7 @@ function prof_chunk_report() -> void {
}
function prof_gen_frame() -> void {
ds_frame()
if not prof_on { return }
if prof_gen == null {
prof_gen = new []int; prof_ft = new []long