Parent
- Program: ENG2 — GoudEngine v2 Rebuild (see the pinned master tracking issue)
- Phase / Milestone: Phase 2 — Render Core v2 (
eng2-p2-render-core)
- Batch / Group: Batch 2.2 — Upload rearchitecture, Group B
- Runbook spec:
docs/src/runbook/phases/phase-2.md (committed with the roadmap)
Summary
Replace full static-batch re-bakes on any scene change with incremental per-chunk static batching that adds/removes individual objects without rebuilding the whole batch, and moves vertex transforms onto the GPU instead of pre-transforming on the CPU.
Architecture Context
Layer: Layer 2 (Libs) — libs/graphics/renderer3d/ (see tools/lint_layers.rs — downward-only deps).
Modules/types touched:
goud_engine/src/libs/graphics/renderer3d/core_static_batch.rs — rebuild_static_batch re-bakes the entire batch whenever static_batch_dirty is set.
goud_engine/src/libs/graphics/renderer3d/core/mod.rs (around the static-batch bake path) — currently pre-bakes CPU-transformed vertices into one VBO.
Boundary constraints (only those that apply):
- Raw GPU calls stay in
libs/graphics/backend/ — no wgpu:: outside it.
Pattern to follow: Chunked spatial partitioning (align with the chunking approach used by ENG2-P2-11's tilemap-grid primitive, since that issue depends on this one).
Scope
Acceptance Criteria
Breaking Change & Throne Follow-up
None — additive/internal. Static batch external behavior (what gets drawn) is unchanged; only the bake granularity and transform location change.
Blocked By
None.
Files Likely Touched
- New/Modified/Generated:
goud_engine/src/libs/graphics/renderer3d/core_static_batch.rs, renderer3d/core/mod.rs (static-batch bake path)
Agent Notes
core_static_batch.rs:27-35 rebuild_static_batch re-bakes everything whenever static_batch_dirty is set — one dirty object forces a full rebuild.
core/mod.rs:159 (current bake path) pre-bakes CPU-transformed vertices into one VBO — this is extra CPU work per bake and prevents any incremental update, since the baked positions are already world-space.
- ENG2-P2-11 (chunked tilemap-grid primitive) is blocked on this issue landing first — that primitive needs per-chunk static batches that can scroll/rebind without destroy/recreate, which requires this issue's chunking model to exist.
Verification
cargo check && cargo fmt --all -- --check && cargo clippy -- -D warnings
cargo test
./codegen.sh && git diff --exit-code
Parent
eng2-p2-render-core)docs/src/runbook/phases/phase-2.md(committed with the roadmap)Summary
Replace full static-batch re-bakes on any scene change with incremental per-chunk static batching that adds/removes individual objects without rebuilding the whole batch, and moves vertex transforms onto the GPU instead of pre-transforming on the CPU.
Architecture Context
Layer: Layer 2 (Libs) —
libs/graphics/renderer3d/(seetools/lint_layers.rs— downward-only deps).Modules/types touched:
goud_engine/src/libs/graphics/renderer3d/core_static_batch.rs—rebuild_static_batchre-bakes the entire batch wheneverstatic_batch_dirtyis set.goud_engine/src/libs/graphics/renderer3d/core/mod.rs(around the static-batch bake path) — currently pre-bakes CPU-transformed vertices into one VBO.Boundary constraints (only those that apply):
libs/graphics/backend/— nowgpu::outside it.Pattern to follow: Chunked spatial partitioning (align with the chunking approach used by ENG2-P2-11's tilemap-grid primitive, since that issue depends on this one).
Scope
goud_engine/tests/spec/+ unit/isolation coverage for the new code paths..agents/rules/graphics-patterns.mdordocs/src/*.Acceptance Criteria
cargo check && cargo fmt --all -- --check && cargo clippy -- -D warningsclean;cargo testgreen;./codegen.sh && git diff --exit-code(drift gate)Breaking Change & Throne Follow-up
None — additive/internal. Static batch external behavior (what gets drawn) is unchanged; only the bake granularity and transform location change.
Blocked By
None.
Files Likely Touched
goud_engine/src/libs/graphics/renderer3d/core_static_batch.rs,renderer3d/core/mod.rs(static-batch bake path)Agent Notes
core_static_batch.rs:27-35rebuild_static_batchre-bakes everything wheneverstatic_batch_dirtyis set — one dirty object forces a full rebuild.core/mod.rs:159(current bake path) pre-bakes CPU-transformed vertices into one VBO — this is extra CPU work per bake and prevents any incremental update, since the baked positions are already world-space.Verification