donut
donut copied to clipboard
Getting multiple compilation errors and failed assertions from `donut` submodule
I am creating a project over the donut framework, but I am not able to configure the project correctly. Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
# Project Name: CirrusRT
project(CirrusRT)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_ITERATOR_DEBUG_LEVEL=1")
# Link directory for Assimp
link_directories(third-party/assimp/)
set(NVRHI_WITH_VULKAN ON)
add_subdirectory(third-party/donut)
include_directories(
include/
./third-party/donut/include/
)
# Source Files glob for LibCirrusRT
file(GLOB_RECURSE SOURCES "src/*.cpp" "include/*.h")
# Adding CirrusRT.exe executable
add_executable(${PROJECT_NAME} WIN32 ${SOURCES})
# Linking assimp-vc143-mt.lib
target_link_libraries(${PROJECT_NAME} donut_core donut_engine donut_app assimp-vc143-mt)
# Copying assimp-vc-143-mt.dll from third-party/assimp/ to build/
configure_file(third-party/assimp/assimp-vc143-mt.dll ${CMAKE_CURRENT_BINARY_DIR}/assimp-vc143-mt.dll COPYONLY)
# Setting CirrusRT.exe's runtime output directory to CMake's current binary directory
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
The project structure is as follows:
./
|_CMakeLists.txt
|_include/
| |_*.h
|_src/
| |_*.cpp
|_third-party/
| |_donut/
While building the generated solution, I am getting many errors leading to a failed build. Some of them are listed below:
Severity Code Description Project File Line Suppression State
Error C2440 '<function-style-cast>': cannot convert from 'vk::PipelineLayout' to 'nvrhi::Object' nvrhi_vk C:\Projects\cirrus-rt\third-party\donut\nvrhi\src\vulkan\vulkan-compute.cpp 141
Severity Code Description Project File Line Suppression State
Error C2664 'void nvrhi::vulkan::VulkanContext::nameVKObject(const void *,vk::DebugReportObjectTypeEXT,const char *) const': cannot convert argument 1 from 'VkBuffer' to 'const void *' nvrhi_vk C:\Projects\cirrus-rt\third-party\donut\nvrhi\src\vulkan\vulkan-buffer.cpp 132
Severity Code Description Project File Line Suppression State
Error C2607 static assertion failed (compiling source file C:\Projects\cirrus-rt\third-party\donut\src\core\chunk\chunkWriter.cpp) donut_core C:\Projects\cirrus-rt\third-party\donut\include\donut\core\chunk\chunk.h 64
Severity Code Description Project File Line Suppression State
Error C2664 'void AppendBufferRange(nvrhi::BufferRange &,size_t,uint64_t &)': cannot convert argument 3 from 'size_t' to 'uint64_t &' donut_engine C:\Projects\cirrus-rt\third-party\donut\src\engine\Scene.cpp 1035
Severity Code Description Project File Line Suppression State
Error C2065 'DXC_ARG_OPTIMIZATION_LEVEL2': undeclared identifier ShaderMake (ShaderMake\ShaderMake) C:\Projects\cirrus-rt\third-party\donut\ShaderMake\src\ShaderMake.cpp 883
Severity Code Description Project File Line Suppression State
Error C2672 'std::min': no matching overloaded function found nvrhi_d3d12 C:\Projects\cirrus-rt\third-party\donut\nvrhi\src\d3d12\d3d12-texture.cpp 1183