Skip to content

Phase 1: RHI Interface Segregation Cleanup #453

@MichaelFisher1997

Description

@MichaelFisher1997

Phase 1: RHI Interface Segregation Cleanup

Goal

Finish the RHI interface split by removing deprecated methods from IRenderContext and routing consumers through focused interfaces.

Why this matters

src/engine/graphics/rhi.zig still exposes a broad IRenderContext with methods that already belong to smaller interfaces. That weakens ISP and keeps the rest of the codebase coupled to legacy convenience methods.

Parallel Tasks

Issue 1.1: Remove computeSSAO from IRenderContext

  • Type: refactor / solid
  • Scope: src/engine/graphics/rhi.zig
  • Problem: computeSSAO is duplicated on IRenderContext even though ISSAOContext already exists.
  • Work:
    • Remove computeSSAO from IRenderContext.VTable
    • Remove the IRenderContext.computeSSAO() forwarding method
    • Update any direct callers to use rhi.ssao() or rhi.ssao().compute(...)
  • Acceptance criteria:
    • IRenderContext no longer exposes SSAO-specific behavior
    • Build passes
    • No remaining call sites depend on the removed method
  • Parallel-safe: yes, if no one else is editing the same call sites

Issue 1.2: Remove drawDebugShadowMap from IRenderContext

  • Type: refactor / solid
  • Scope: src/engine/graphics/rhi.zig
  • Problem: debug overlay behavior is still embedded in the general render context.
  • Work:
    • Remove drawDebugShadowMap from IRenderContext.VTable
    • Remove the IRenderContext.drawDebugShadowMap() forwarding method
    • Ensure the debug overlay path uses IDebugOverlayContext
  • Acceptance criteria:
    • Debug shadow rendering is accessed through the dedicated interface only
    • Build passes
  • Parallel-safe: yes

Issue 1.3: Route SSAO calls through ISSAOContext in the render graph

  • Type: refactor / solid
  • Scope: src/engine/graphics/render_graph.zig, call sites that build SceneContext
  • Problem: the render graph already receives ISSAOContext, but the codebase still needs a clean, explicit dependency path.
  • Work:
    • Audit SceneContext construction and ensure SSAO work always uses ssao_ctx
    • Remove any remaining render-context-based SSAO assumptions
    • Update comments/docs to reflect the focused interface
  • Acceptance criteria:
    • Render graph code only references ISSAOContext for SSAO work
    • No lingering comments or docs describe SSAO as a render-context concern
  • Parallel-safe: yes

Dependencies

  • None required before Phase 1

Verification

  • nix develop --command zig build test
  • nix develop --command zig build

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions