Skip to content

Commit

Permalink
v1.141:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- added a new extension "NRIResourceAllocator", which adds a simple way to create resources already bound to memory. Moreover, this extension uses AMD Vulkan/D3D12 MemoryAllocator under the hood, allowing to not only efficiently bind resources to memory chunks, but also track free memory segments, reusing them for subsequent allocations. Most likely, in the future this extension will get more MA functionality (statistics at least)

BREAKING CHANGES:
- Core: "MemoryAllocatorInterface" renamed to "AllocationCallbacks" (similarly for "memoryAllocatorInterface")
- Core: "DeviceDesc::memoryTier" replaced with "DeviceDesc::isMemoryTier2Supported"
- Raytracing: "GetAccelerationStructureMemoryDesc" made "AccelerationStructure" object independent
- WrapperVK: "GetVk*" replaced with "Get*VK" to match the style

DETAILS:
- NRI: added new extension "NRIResourceAllocator", which allows to create bound-to-memory resources
- NRI: alignment info grouped in one place in "DeviceDesc"
- NRI: fixed "NRI_STATIC_LIBRARY"
- Creation: exposed "DeviceCreationDesc::disable3rdPartyAllocationCallbacks" to use "allocationCallbacks" only for NRI needs
- WrapperD3D12: removed unnecessary arguments
- WrapperVK: removed unnecessary arguments
- WrapperVK: minimized number of "mimic" types
- Validation: tweaks and adjustments
- introduced `NRI_OPTIONAL` to improve readability of main headers
- bug fixes and improvements
- improved comments in main headers
- massive refactoring and code cleanup
  • Loading branch information
dzhdanNV committed Aug 23, 2024
1 parent c3a8e38 commit 2104586
Show file tree
Hide file tree
Showing 119 changed files with 34,364 additions and 3,351 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ if (WIN32 AND NRI_ENABLE_D3D12_SUPPORT)
set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRI_USE_D3D12=1)
set (INPUT_LIBS_D3D12 ${INPUT_LIB_D3D12} ${INPUT_LIB_DXGI})

file (GLOB D3D12_SOURCE "Source/D3D12/*.cpp" "Source/D3D12/*.h" "Source/D3D12/*.hpp")
file (GLOB D3D12_SOURCE "Source/D3D12/*.cpp" "Source/D3D12/*.h" "Source/D3D12/*.hpp" "External/memalloc/D3D12*.*")
source_group ("" FILES ${D3D12_SOURCE})

if (NRI_ENABLE_EXTERNAL_LIBRARIES)
Expand Down Expand Up @@ -214,10 +214,10 @@ if (NRI_ENABLE_VK_SUPPORT)
message ("NRI adding backend: VK")
set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRI_USE_VULKAN=1)

file (GLOB VK_SOURCE "Source/VK/*.cpp" "Source/VK/*.h" "Source/VK/*.hpp")
file (GLOB VK_SOURCE "Source/VK/*.cpp" "Source/VK/*.h" "Source/VK/*.hpp" "External/memalloc/vk_mem_alloc.h")
source_group ("" FILES ${VK_SOURCE})
add_library (NRI_VK STATIC ${VK_SOURCE})
target_include_directories (NRI_VK PRIVATE "Include" "Source/Shared" "External/vulkan/include")
target_include_directories (NRI_VK PRIVATE "Include" "Source/Shared" "External" "External/vulkan/include")
target_compile_definitions (NRI_VK PRIVATE ${COMPILE_DEFINITIONS})
target_compile_options (NRI_VK PRIVATE ${COMPILE_OPTIONS})
target_link_libraries (NRI_VK PRIVATE NRI_Shared)
Expand Down Expand Up @@ -283,6 +283,7 @@ file (GLOB NRI_RESOURCES "Resources/*")
source_group ("Resources" FILES ${NRI_RESOURCES})

if (NRI_STATIC_LIBRARY)
set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRI_STATIC_LIBRARY)
add_library (${PROJECT_NAME} STATIC ${NRI_SOURCE} ${NRI_HEADERS} ${NRI_RESOURCES} ${NRI_EXTENSIONS})
else ()
add_library (${PROJECT_NAME} SHARED ${NRI_SOURCE} ${NRI_HEADERS} ${NRI_RESOURCES} ${NRI_EXTENSIONS})
Expand Down
Loading

0 comments on commit 2104586

Please sign in to comment.