This video documents the integration of NVRHI (NVIDIA Rendering Hardware Interface) into the Hazel Engine, marking the transition from an exclusive Vulkan backend to a hardware-abstracted rendering architecture. The update, dubbed "Renderer 2025," leverages NVRHI to manage resource states and API-specific complexities, enabling Hazel to target DirectX 11/12 alongside Vulkan. The summary details the architectural shift, the division of labor between the engine's abstraction layer and the NVRHI library, and the ongoing challenges regarding shader compilation pipelines.
Technical Summary
0:03 Architectural Pivot: Hazel has transitioned from a custom Vulkan-specific renderer to using NVRHI, an abstraction layer that sits between the engine and underlying graphics APIs (Vulkan, D3D11, D3D12).
1:13 RHI Integration: NVRHI replaces the bespoke engine-side abstraction of multiple backends, handling resource state tracking and barrier placement—tasks previously managed manually by the engine.
2:52 Vendor Compatibility: NVRHI provides more robust validation than previous implementations, leading to improved stability across GPU vendors, specifically addressing AMD driver pedantry compared to NVIDIA’s more forgiving error handling.
4:11 Scope Limitations: The integration is primarily backend-focused; it does not solve the shader pipeline abstraction. Hazel currently lacks a unified shader compiler, necessitating separate paths for DXBC (D3D11) and DXIL (D3D12), though a shift toward SPIR-V for all backends is anticipated with Shader Model 7.
13:22 Runtime vs. Compile-time: The engine maintains a runtime-selectable render API, allowing users to toggle backends at startup rather than requiring separate engine binaries for each API.
15:35 Implementation Details: The abstraction layer has shifted; classes like VertexBuffer now interface directly with the NVRHI device, which subsequently maps to the platform-specific implementation (e.g., VKBuffer).
16:33 Ownership and Forking: Hazel maintains a fork of NVRHI, allowing for direct patching of the library to handle engine-specific edge cases, mitigating the risk of relying on third-party code.
18:40 Unresolved Components: High-level application concerns—specifically the Swap Chain—remain outside of NVRHI’s scope and continue to be handled by the engine’s Platform layer.
Recommended Reviewers for this Topic
To critically evaluate this technical transition, I recommend the following expertise group:
Low-Level Graphics API Specialists: Individuals with deep experience in Vulkan/DX12 to critique the resource synchronization model implemented by NVRHI.
Engine Architects: Experts in engine middleware to assess the tradeoff between maintaining custom abstractions versus adopting vendor-provided RHI libraries.
Compiler Engineers/Technical Artists: Professionals focused on shader toolchains to discuss the complexities of the SPIR-V/DXIL pipeline and cross-platform shader authoring.