NRI is a low-level abstract render interface which currently supports three backends: D3D11, D3D12 and Vulkan (VK). NRI has been designed to support all (at least major) low level features of D3D12 and VK APIs, but at the same time to simplify usage and reduce the amount of code needed (especially compared with VK). NRI is written in C++, but supports both C++ and C interfaces.
Goals:
Non-goals:
Key features:
can be used as a shared or static library.
NRI is used in:
C++ | C |
---|---|
nri::Interface |
NriInterface |
nri::Enum::MEMBER |
NriEnum_MEMBER |
nri::CONST |
NRI_CONST |
nri::nriFunction |
nriFunction |
nri::Function |
nriFunction |
Reference & |
Pointer * |
NRI | D3D11 | D3D12 | VK |
---|---|---|---|
Device |
ID3D11Device |
ID3D12Device |
VkDevice |
CommandBuffer |
ID3D11DeviceContext (deferred) |
ID3D12CommandList |
VkCommandBuffer |
CommandQueue |
ID3D11DeviceContext (immediate) |
ID3D12CommandQueue |
VkQueue |
Fence |
ID3D11Fence |
ID3D12Fence |
VkSemaphore (timeline) |
CommandAllocator |
N/A | ID3D12CommandAllocator |
VkCommandPool |
Buffer |
ID3D11Buffer |
ID3D12Resource |
VkBuffer |
Texture |
ID3D11Texture |
ID3D12Resource |
VkImage |
Memory |
N/A | ID3D12Heap |
VkDeviceMemory |
Descriptor |
ID3D11*View |
D3D12_CPU_DESCRIPTOR_HANDLE |
Vk*View or VkSampler |
DescriptorSet |
N/A | N/A | VkDescriptorSet |
DescriptorPool |
N/A | ID3D12DescriptorHeap |
VkDescriptorPool |
PipelineLayout |
N/A | ID3D12RootSignature |
VkPipelineLayout |
Pipeline |
ID3D11*Shader and ID3D11*State |
ID3D12StateObject |
VkPipeline |
AccelerationStructure |
N/A | ID3D12Resource |
VkAccelerationStructure |
1-Deploy
2-Build
Notes:
NRI_STATIC_LIBRARY
- build NRI as a static library (off
by default)NRI_ENABLE_VK_SUPPORT
- enable VULKAN backend (on
by default)NRI_ENABLE_D3D11_SUPPORT
- enable D3D11 backend (on
by default on Windows)NRI_ENABLE_D3D12_SUPPORT
- enable D3D12 backend (on
by default on Windows)VK only:
NRI_ENABLE_XLIB_SUPPORT
- enable Xlib support (on
by default)NRI_ENABLE_WAYLAND_SUPPORT
- enable Wayland support (on
by default)D3D12 only:
NRI_ENABLE_AGILITY_SDK_SUPPORT
- enable Agility SDK (off
by default)NRI_AGILITY_SDK_PATH
- path to a directory containing Agility SDK: contents of .nupkg/build/native/
(C:/AgilitySDK
by default)NRI_AGILITY_SDK_VERSION
- Agility SDK version (711
or newer)NRI_AGILITY_SDK_DIR
- directory where Agility SDK binaries will be copied to relative to CMAKE_RUNTIME_OUTPUT_DIRECTORY
(AgilitySDK
by default)Overview and Download sections can be found here.
D3D12 backend uses Agility SDK to get access to most recent D3D12 features. As soon as these features become available in the OS, installation of Agility SDK will be deprecated.
Installation steps:
preview
versions require enabling Developer Mode in Windows.nupkg
into .zip
.nupkg/build/native
into NRI_AGILITY_SDK_PATH
folder
NRI_AGILITY_SDK_DIR
to a path, where bin
folder needs to be copied
NRI_AGILITY_SDK_VERSION
to the version of the packageNRI_ENABLE_AGILITY_SDK_SUPPORT
NRIAgilitySDK.h
header in the code of your executable, using NRINRI samples can be found here.
Samples:
NRI is licensed under the MIT License. This project includes NVAPI software. All uses of NVAPI software are governed by the license terms specified here.