$ show NVIDIA-RTX/NVRHI
NVRHI is a C++ hardware abstraction layer for real-time GPU programming. It exposes a single vendor-neutral RHI API (defined in include/nvrhi/nvrhi.h) and implements it through D3D11, D3D12, and Vulkan backends. Applications interact with interfaces such as IDevice, ICommandList, IBuffer, ITexture, and pipeline objects, while each backend translates those calls into native graphics API operations. The library is not an application or service; its primary entry points are device factory functions like nvrhi::d3d12::createDevice, nvrhi::d3d11::createDevice, and nvrhi::vulkan::createDevice, plus an optional validation layer created through nvrhi::validation::createValidationLayer.
The LLM identified 5 files worth highlighting for reuse:
Provides static_vector<T,N>, a compile-time fixed-capacity vector with no heap allocation. It is a self-contained, header-only utility suitable for performance-critical graphics code and can be lifted directly into another C++ project.
Defines RefCountPtr<T>, an intrusive reference-counted smart pointer using AddRef/Release semantics analogous to ComPtr. The pattern is cleanly isolated and reusable wherever COM-style ownership semantics are needed.
Contains BitSetAllocator, a thread-safe bitmask allocator for handing out integer indices such as timer query slots. It solves a recurring GPU/API resource-index allocation problem and is small enough to extract into a standalone utility.
Implements DxgiFormatMapping, a bidirectional mapping between NVRHI abstract formats and DXGI formats. This is a self-contained conversion table that demonstrates a clean pattern for isolating API-specific format conversions behind a reusable abstraction.
Implements DeviceWrapper, which decorates IDevice implementations with runtime parameter checking and diagnostic error reporting. The decorator pattern keeps validation separate from real backends and is a strong reference for adding non-intrusive validation layers to large API surfaces.