Skip to content

ENG2-P2-03: Remove the legacy glfw/OpenGL backend (execute ADR P0-10) #715

Description

@aram-devdocs

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.1 — Foundations from RFC-0005, Group B
  • Runbook spec: docs/src/runbook/phases/phase-2.md (committed with the roadmap)

Summary

Delete the legacy legacy-glfw-opengl backend implementation and its glfw platform path, executing the ADR written in ENG2-P0-10, while keeping the RenderBackend trait seam intact for the remaining wgpu backend.

Architecture Context

Layer: Layer 2 (Libs) — libs/graphics/backend/ (see tools/lint_layers.rs — downward-only deps).
Modules/types touched:

  • goud_engine/src/libs/graphics/backend/ — remove the OpenGL/glfw backend implementation behind the legacy-glfw-opengl feature flag.
  • Platform init files that branch on the legacy backend feature.
  • Cargo.toml — drop the legacy-glfw-opengl feature and its glfw/gl dependencies.

Boundary constraints (only those that apply):

  • Raw GPU calls stay in libs/graphics/backend/ — no wgpu:: outside it (this issue removes the gl:: half of that rule, not the boundary itself).
  • The RenderBackend trait abstraction MUST remain — this is a deletion of one implementation, not the seam.

Pattern to follow: ENG2-P0-10 ADR (must be merged before this executes) and .agents/rules/graphics-patterns.md's backend-isolation rule.

Scope

  • Confirm the ADR from ENG2-P0-10 is merged and names the active backend (wgpu/Metal) as the sole path forward.
  • Delete the OpenGL backend implementation and the glfw platform init path.
  • Remove the legacy-glfw-opengl feature flag from Cargo.toml and any cfg-gated code referencing it.
  • Reconcile ARCHITECTURE.md/ALPHA_ROADMAP.md contradiction called out in the ADR.
  • Tests: spec test at goud_engine/tests/spec/ + unit/isolation coverage for the new code paths.
  • Docs/rules updates if this invalidates .agents/rules/graphics-patterns.md or docs/src/*.

Acceptance Criteria

  • legacy-glfw-opengl feature and all gl:: calls are absent from the codebase (grep-gated).
  • RenderBackend trait and the wgpu implementation build and pass all existing renderer tests unchanged.
  • Docs (ARCHITECTURE.md) state wgpu as the only backend, no contradiction remains.
  • cargo check && cargo fmt --all -- --check && cargo clippy -- -D warnings clean; cargo test green; ./codegen.sh && git diff --exit-code (drift gate)

Breaking Change & Throne Follow-up

Breaking. Removes the legacy-glfw-opengl feature and the OpenGL rendering path entirely — no compatibility shim is kept (binding user decision: no legacy code retained where we refactor). Throne is already on the wgpu/Metal path, so no adoption follow-up issue is required for this specific removal — confirm this in the PR description by checking Throne's active feature flags before closing.

Blocked By

ENG2-P0-10 (the ADR deciding this removal must merge first).

Files Likely Touched

  • New/Modified/Generated: goud_engine/src/libs/graphics/backend/ (OpenGL implementation deleted), Cargo.toml, ARCHITECTURE.md

Agent Notes

  • ADR context (ENG2-P0-10): ARCHITECTURE.md says wgpu is the default backend, while ALPHA_ROADMAP.md:1246-1248 claims wgpu is incomplete and GL bypasses the abstraction — this issue executes the ADR's resolution (verify the ADR's conclusion before deleting; do not assume without reading it first).
  • Frees all later Phase 2 work (instancing, dynamic offsets, GPU timestamps) from needing to support two backends simultaneously — sequence this early in Batch 2.1 for that reason, per the batch table.
  • Per the ADR investigation, confirm the live/active backend in code (not just docs) before deleting — RenderBackendKind selection happens at GoudGame init time per .agents/rules/graphics-patterns.md.

Verification

cargo check && cargo fmt --all -- --check && cargo clippy -- -D warnings
cargo test
./codegen.sh && git diff --exit-code

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:renderingRendering pipeline and graphicsbreaking-changeBreaks the SDK/FFI API; requires a Throne adoption follow-uppriority:mediumShould have for alpharoadmap:eng2GoudEngine v2 rebuild program (ENG2)size/Ltarget:goudengineGoudEngine repo onlytype:refactorCode improvement without behavior change

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions