ci / checks (push) Successful in 8m39s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m19s
ci-platforms / darwin amd64 smoke (push) Skipped
ci-platforms / windows amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
ci / release (push) Successful in 8m54s
Shader ABI 1: ub0 frame (16 B), ub1 view (112 B), ub2 material, ub3 mesh draw; tex0 main, tex1 reserved, tex2-tex7 user; @instance lanes in vertex slot 1 at locations 4-7, 64 bytes a sprite. The engine sprite, sprite3d, debug and mesh shaders move to it, and engine includes sprite, color, noise and lighting ship under engine/res/shaders/include. .aeshader files import into an AESH artifact with every variant in both GLSL dialects and a line map; errors are SHD001-SHD009 mapped back to the source file and line, also for driver compile logs. A failed reimport keeps the last good shader. .aemat materials (MAT001-MAT004) reference a shader and textures and are reimported when their shader changes. The material cache in render/material binds a material with no allocations, retires replaced shaders, moves materials to a reimported shader in place (D393) and re-uploads every material after a WebGL context restore. make ci requires glslangValidator (D367). web-bench, baseline retaken on nodea in both GPU modes, the same numbers in swiftshader and hardware, Chromium and Firefox: - the frame UBO is uploaded once a frame: buffer uploads 2 -> 3 a frame; - the view UBO is 112 bytes instead of 64: buffer KB 0.372 -> 0.434 a frame (+16 B frame, +48 B view); - fewer SetUniformBuffer calls a batch: the sprite pass no longer binds the view per batch, frame and view are bound once per view; the GL state cache already deduped that bind, so WebGL calls go 50.49 -> 52.49 a frame with the two new frame-UBO calls, draws 3.31 unchanged; - buffer KB from lanes is unchanged: the demo has no @instance material. Frame time and Go bytes in the engine frame (357 -> 342) do not regress. wasm size, gzip: playground 6.46 -> 6.50 MB, try 6.98 -> 7.01 MB, web runtime 6.05 -> 6.07 MB (total 27.27 -> 27.46, 29.54 -> 29.67, 25.56 -> 25.65 MB).
78 lines
1.9 KiB
Go
78 lines
1.9 KiB
Go
package app
|
|
|
|
import (
|
|
"aego/asset/importers/preset"
|
|
"sort"
|
|
|
|
"aego/asset/importers/atlas"
|
|
matImporter "aego/asset/importers/material"
|
|
"aego/asset/importers/scenefile"
|
|
scriptImporter "aego/asset/importers/script"
|
|
shaderImporter "aego/asset/importers/shader"
|
|
texImporter "aego/asset/importers/texture"
|
|
"aego/asset/pipeline"
|
|
"aego/core/errs"
|
|
"aego/core/log"
|
|
"aego/engine/module"
|
|
"aego/script/workspace"
|
|
)
|
|
|
|
func CoreImporters() (*pipeline.ImporterRegistry, error) {
|
|
reg := pipeline.NewImporterRegistry()
|
|
for _, imp := range []pipeline.Importer{
|
|
atlas.Wrap(texImporter.New()),
|
|
scenefile.NewScene(),
|
|
scenefile.NewPrefab(),
|
|
preset.New(),
|
|
shaderImporter.New(),
|
|
shaderImporter.NewInclude(),
|
|
matImporter.New(),
|
|
} {
|
|
if err := reg.Register(imp); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return reg, nil
|
|
}
|
|
|
|
func DevImporters(ws *workspace.Workspace, man *module.Manifest) (*pipeline.ImporterRegistry, error) {
|
|
imps, err := CoreImporters()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
env := &pipeline.DevEnv{Workspace: ws}
|
|
for _, h := range man.Dev {
|
|
fn, ok := h.Fn.(func(*pipeline.ImporterRegistry, *pipeline.DevEnv) error)
|
|
if !ok {
|
|
return nil, errs.New(errs.EngineModule, "dev hook of "+h.Owner+" has an unsupported type", log.F("module", h.Owner))
|
|
}
|
|
if err := fn(imps, env); err != nil {
|
|
return nil, errs.Wrap(err, errs.EngineModule, "dev hook of "+h.Owner+" failed").With(log.F("module", h.Owner))
|
|
}
|
|
}
|
|
return imps, nil
|
|
}
|
|
|
|
func ScriptErrors(pl *pipeline.Pipeline) []string {
|
|
seen := map[string]bool{}
|
|
var out []string
|
|
for _, a := range pl.Assets() {
|
|
if a.Importer != scriptImporter.ImporterID || a.Error == "" || seen[a.Error] {
|
|
continue
|
|
}
|
|
seen[a.Error] = true
|
|
out = append(out, a.Error)
|
|
}
|
|
sort.Strings(out)
|
|
return out
|
|
}
|
|
|
|
func ScriptImporter(imps *pipeline.ImporterRegistry) *scriptImporter.Importer {
|
|
imp, ok := imps.ByID(scriptImporter.ImporterID)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
si, _ := imp.(*scriptImporter.Importer)
|
|
return si
|
|
}
|