refactor debug info, measure render times

This commit is contained in:
2022-02-21 12:24:05 +08:00
parent 057e8907a9
commit 4a9afb4246
6 changed files with 135 additions and 46 deletions

View File

@ -1,6 +1,10 @@
package io
import "edgaru089.ml/go/gl01/internal/util/itype"
import (
"time"
"edgaru089.ml/go/gl01/internal/util/itype"
)
var (
DisplaySize itype.Vec2i // Size of the window viewport in pixels.
@ -13,4 +17,19 @@ var (
RenderPos, RenderDir itype.Vec3d // Position and Direction of view for the current render pass. Might be different for e.g. lighting passes
ShowDebugInfo bool // Show debug info (F3 screen)?
// Per-Frame Diagnostics information
Diagnostics struct {
CgoCalls int64 // Cgo calls in the last frame
Times struct { // Times spent
GUI, Logic, Render time.Duration
RenderPasses struct {
Depthmap,
Geometry,
SSAO,
Lighting,
Postfx time.Duration
}
}
}
)