Files
sanspie 17cb5e4291 Stage 2-5: assets, scene/ECS, editor, 3D, and Aego Script
Stage 2: render pipeline and UI toolkit over gpu/platform.
Stage 3: schema registry, asset pipeline + runtime loader, scene graph and ECS.
Stage 4: editor — docking, inspector, scene/game views, play mode, asset browser, console, profiler; 4.5 adds the 3D foundation (mixed 2D/3D spaces, meshes, depth).
Stage 5: Aego Script — compiler (lexer/parser/types/resolver/checker/asm/compiler), bytecode with verifier and register VM, instance runtime, stdlib, native bindings, and editor/CLI integration (aego run/edit/check/test/dump).
2026-10-08 13:17:28 +03:00

42 lines
1003 B
Go

package debug
import (
"testing"
"aego/core/mathx"
"aego/gpu/null"
)
func TestSpacesUploadContiguously(t *testing.T) {
d, err := New(null.New(), 256)
if err != nil {
t.Fatal(err)
}
defer d.Close()
d.Line(mathx.Vec2{}, mathx.Vec2{X: 1}, mathx.Color{A: 1})
d.Space(Overlay)
d.AABB3(mathx.AABB3{Max: mathx.Vec3{X: 1, Y: 1, Z: 1}}, mathx.Color{A: 1})
d.Space(Screen)
d.Cross(mathx.Vec2{}, 4, mathx.Color{A: 1})
w, o, s := d.Upload()
if w != (Range{0, 2}) || o != (Range{2, 24}) || s != (Range{26, 4}) {
t.Fatalf("ranges = %v %v %v", w, o, s)
}
}
func TestBudgetIsShared(t *testing.T) {
d, _ := New(null.New(), 8)
defer d.Close()
d.Grid3(mathx.Vec3{}, 1, 5, mathx.Color{A: 1})
w, o, s := d.Counts()
if w+o+s > 8 || d.Dropped() == 0 {
t.Fatalf("counts=%d,%d,%d dropped=%d", w, o, s, d.Dropped())
}
if n := testing.AllocsPerRun(100, func() {
d.Reset()
d.Line3(mathx.Vec3{}, mathx.Vec3{X: 1}, mathx.Color{A: 1})
}); n != 0 {
t.Fatalf("debug lines allocate: %.1f", n)
}
}