Part of #776 — SOLID architecture debt umbrella.
Phase: P3 · Finding: M16
Problem
Three related contract gaps:
- M16:
modules/engine-rhi/src/render_device.zig — RenderDevice.createBuffer returns a handle never wired to the backend; backend_data always null. The real IResourceFactory.createBuffer ignores RenderDevice. Split-brain.
- M14:
rhi_vulkan.zig:764-769 bindShader is a silent no-op in Vulkan but in the public IGraphicsCommandEncoder contract.
- m5:
render_device.zig:14 doc-comment advertises a backend_type parameter the real signature lacks.
Evidence
rhi_vulkan.zig:764-769:
fn bindShader(ctx_ptr, handle) void {
_ = ctx_ptr;
if (handle != rhi.InvalidShaderHandle) {
log.log.warn("Vulkan RHI bindShader({}) ignored: fixed pipelines...", .{handle});
}
}
Fix
- RenderDevice: wire it to the backend or delete it. The split-brain confuses every reader.
- bindShader: either honor the contract or remove the method. A silent no-op is the worst option.
- Doc lie: implement the
backend_type parameter or fix the doc.
Verification
nix develop --command zig build test (includes shader validation)
- If rendering-touching: capture headless screenshot baseline before/after (
-Dskip-present)
- If behavior-preserving refactor: golden-output test must stay green
Constraints
- Small reviewable PR targeting
dev; conventional commit (refactor: / feat:)
- Preserve current behavior unless this issue explicitly changes it
- Keep worker-thread RHI isolation intact (no RHI calls off main thread)
Notes
M14 may be resolved implicitly by C2 (native handles elimination) — check before implementing.
Tracking: #776
Part of #776 — SOLID architecture debt umbrella.
Phase: P3 · Finding: M16
Problem
Three related contract gaps:
modules/engine-rhi/src/render_device.zig—RenderDevice.createBufferreturns a handle never wired to the backend;backend_dataalwaysnull. The realIResourceFactory.createBufferignoresRenderDevice. Split-brain.rhi_vulkan.zig:764-769bindShaderis a silent no-op in Vulkan but in the publicIGraphicsCommandEncodercontract.render_device.zig:14doc-comment advertises abackend_typeparameter the real signature lacks.Evidence
rhi_vulkan.zig:764-769:Fix
backend_typeparameter or fix the doc.Verification
nix develop --command zig build test(includes shader validation)-Dskip-present)Constraints
dev; conventional commit (refactor:/feat:)Notes
M14 may be resolved implicitly by C2 (native handles elimination) — check before implementing.
Tracking: #776