Repository navigation
feat(wgpu): add backend.manifest.zon — manifest-splice codegen (#386 step 2) - #426
Conversation
…step 2) wgpu step 2 of out-of-tree extraction (after window conformance #424). Presence of backends/wgpu/backend.manifest.zon opts the wgpu DESKTOP build into the manifest-splice path (manifest_splice.zig) instead of the enum `switch (cfg.backend)` sections in build_zig.txt — exactly as bgfx did in #396. Loop-style, desktop-only (wgpu has no wasm/android target). No params: the fragments take no gamepad/gui toggles and wgpu pulls no shared gamepad sub-package, so unlike bgfx there's no core-diamond override. build_fragments/{backend_dep,link}.txt are the verbatim .backend_wgpu / .link_wgpu section bodies. Output is BYTE-IDENTICAL to the enum path (diffed a generated baseline: 0 differences). `zig build test` green (golden suites unchanged). This is the step that lets wgpu's build sections travel WITH the package on extraction.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds Changeswgpu Backend Manifest and Build Wiring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the wgpu backend manifest and build fragments to support the pluggable-backends codegen path, and updates backends/wgpu/src/window.zig to reset the window contract state (quit_requested and last_frame_time) during initialization. The reviewer suggests also resetting the gpu_ready flag to false in initWindow to prevent potential panics or undefined behavior during sequential runs or integration tests.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| quit_requested = false; | ||
| last_frame_time = 0; |
There was a problem hiding this comment.
The persistent state flag gpu_ready is not reset to false when the window is closed or re-initialized. If a subsequent call to initWindow fails during initGpu (or if closeWindow is called), gpu_ready will remain true from the previous successful run. This can cause endDrawing or ensureSurface to proceed with rendering, attempting to access invalid or unallocated GPU resources (such as sprite_vertex_buffer which is set to null in closeWindow), leading to a panic or undefined behavior.
Resetting gpu_ready to false during initialization ensures a clean state for sequential runs or integration tests, adhering to the general rule: Reset persistent state flags (such as exit or quit request latches) during initialization functions to ensure a clean state for sequential runs or integration tests.
quit_requested = false;
last_frame_time = 0;
gpu_ready = false;
References
- Reset persistent state flags (such as exit or quit request latches) during initialization functions to ensure a clean state for sequential runs or integration tests.
…427) gpu_ready stayed true after closeWindow released the GPU resources (sprite buffers/pipeline → null), so a stray endDrawing/ensureSurface post-close — or a re-init whose initGpu fails — would pass the `if (!gpu_ready)` guard and touch freed handles. Reset it to false in closeWindow (resources freed) and at the top of initWindow (initGpu sets it true on success). gemini High on #426; completes the re-init state hygiene started in #425.
wgpu extraction step 2 (after window conformance #424). Mirrors bgfx #396.
Adds
backends/wgpu/backend.manifest.zon+build_fragments/{backend_dep,link}.txt. Presence of the manifest opts the wgpu desktop build into the manifest-splice codegen path (manifest_splice.zig) instead of the enumswitch (cfg.backend)sections inbuild_zig.txt..backend_wgpu/.link_wgpusection bodies.Verified byte-identical
Generated a wgpu desktop
build.zigbaseline (enum path), added the manifest, regenerated (splice path) → 0 diff.zig build testgreen (golden suites unchanged).Next: extract wgpu to
labelle-wgpu, then flipbuiltinProvider(.wgpu).Summary by CodeRabbit
New Features
Bug Fixes