-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First round of optimizations and modernization
- Loading branch information
1 parent
830b0bd
commit da7fa13
Showing
34 changed files
with
1,876 additions
and
2,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
[Aa]ssets/[Tt]emp | ||
thirdparty/gvdb-voxels/ | ||
|
||
instancer_hda/scenes/backup | ||
instancer_hda/scenes/backup | ||
|
||
*.pdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "thirdparty/cuda-noise"] | ||
path = thirdparty/cuda-noise | ||
url = https://github.com/sergeneren/cuda-noise | ||
[submodule "vcpkg"] | ||
path = vcpkg | ||
url = https://github.com/microsoft/vcpkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": 4, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 25, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "Default", | ||
"displayName": "Development Configuration", | ||
"description": "Default configuration for dev environment", | ||
"binaryDir": "${sourceDir}/build/", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": { | ||
"type": "FILEPATH", | ||
"value": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
}, | ||
"BUILD_VPT": { | ||
"type": "BOOLEAN", | ||
"value": "ON" | ||
}, | ||
"OpenImageDenoise_DIR": "${sourceDir}/thirdparty/OpenImageDenoise/lib/cmake/OpenImageDenoise-2.1.0", | ||
"CMAKE_CONFIGURATION_TYPES": "RelWithDebInfo", | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkg/vcpkg_installed", | ||
"VCPKG_BUILD_TYPE": "release", | ||
"VCPKG_TARGET_TRIPLET": "x64-windows" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "Default", | ||
"configurePreset": "Default", | ||
"displayName": "Build RelWithDebInfo", | ||
"description": "Build RelWithDebInfo configuration", | ||
"configuration": "RelWithDebInfo" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@echo off | ||
|
||
setlocal | ||
|
||
git submodule init | ||
git submodule update | ||
|
||
if not exist ./vcpkg/vcpkg.exe ( | ||
call ./vcpkg/bootstrap-vcpkg.bat | ||
) | ||
|
||
if not exist ./vcpkg/vcpkg.exe ( | ||
echo Unable to bootstrap vcpkg! | ||
exit 1 | ||
) | ||
|
||
if exist build rmdir /s /q build | ||
|
||
cmake --preset Default . | ||
if errorlevel 1 ( | ||
echo failed to configure | ||
exit 1 | ||
) | ||
|
||
|
||
cmake --build ./build --preset Default | ||
if errorlevel 1 ( | ||
echo failed to build | ||
exit 1 | ||
) | ||
|
||
echo Successfully built VPT! You can find the executable under build/bin directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
#------------------------------------ CROSS-PLATFORM OBJ COMPILE | ||
|
||
FUNCTION( COMPILE_OBJ ) | ||
set(options "") | ||
set(oneValueArgs TARGET_PATH TYPE GENERATED GENPATHS) | ||
set(multiValueArgs OPTIONS SOURCES ARCHS INCLUDE) | ||
CMAKE_PARSE_ARGUMENTS( _FUNCTION "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
# Match the bitness of the ptx to the bitness of the application | ||
set( MACHINE "--machine=32" ) | ||
if( CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set( MACHINE "--machine=64" ) | ||
endif() | ||
unset ( CUBIN_FILES CACHE ) | ||
unset ( CUBIN_FILES_PATH CACHE ) | ||
unset ( EMBEDDED_FILES CACHE ) | ||
|
||
FOREACH(INCLUDE_DIR ${_FUNCTION_INCLUDE}) | ||
set ( INCL ${INCL} "-I\"${INCLUDE_DIR}\"" ) | ||
ENDFOREACH() | ||
|
||
set ( ARCHS -arch=sm_61 ) | ||
|
||
message(STATUS "Compiling for architecture ${ARCH}") | ||
|
||
file ( MAKE_DIRECTORY "${_FUNCTION_TARGET_PATH}" ) | ||
string (REPLACE ";" " " _FUNCTION_OPTIONS "${_FUNCTION_OPTIONS}") | ||
separate_arguments( _OPTS WINDOWS_COMMAND "${_FUNCTION_OPTIONS}" ) | ||
message ( STATUS "NVCC Options: ${_FUNCTION_OPTIONS}" ) | ||
message ( STATUS "NVCC Include: ${_FUNCTION_INCLUDE}" ) | ||
|
||
#Set initial options | ||
set(_OPTS ${_OPTS} -Xcompiler "/EHsc,/Od,/Zi,/RTC1" ${ARCHS}) | ||
|
||
#Set debug or relase linking | ||
if(_FUNCTION_TYPE MATCHES "Debug") | ||
set(_OPTS ${_OPTS} -Xcompiler "/MDd") | ||
else() | ||
set(_OPTS ${_OPTS} -Xcompiler "/MD") | ||
endif() | ||
|
||
set(_OPTS ${_OPTS} -w) | ||
|
||
FOREACH( input ${_FUNCTION_SOURCES} ) | ||
get_filename_component( input_ext ${input} EXT ) | ||
get_filename_component( input_without_ext ${input} NAME_WE ) | ||
if ( ${input_ext} STREQUAL ".cu" ) | ||
set(_EXT .lib) | ||
|
||
set( output "${input_without_ext}.lib" ) | ||
set( output_with_path "${_FUNCTION_TARGET_PATH}/${input_without_ext}${_EXT}" ) | ||
set( output_with_quote "\"${output_with_path}\"" ) | ||
LIST( APPEND OBJ_FILES ${output} ) | ||
LIST( APPEND OBJ_FILES_PATH ${output_with_path} ) | ||
|
||
message( STATUS "NVCC Compile: ${CUDA_NVCC_EXECUTABLE} ${MACHINE} --lib -cudart static ${DEBUG_FLAGS} ${_OPTS} ${input} -o ${output_with_path} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}") | ||
add_custom_command( | ||
OUTPUT ${output_with_path} | ||
MAIN_DEPENDENCY ${input} | ||
DEPENDS ${_FILE_DEPENDENCY} | ||
COMMAND ${CUDA_NVCC_EXECUTABLE} ${MACHINE} --compile ${DEBUG_FLAGS} ${OPT_FLAGS} ${_OPTS} ${input} ${INCL} -o ${output_with_quote} | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
endif() | ||
ENDFOREACH( ) | ||
|
||
set( ${_FUNCTION_GENERATED} ${OBJ_FILES} PARENT_SCOPE) | ||
set( ${_FUNCTION_GENPATHS} ${OBJ_FILES_PATH} PARENT_SCOPE) | ||
|
||
ENDFUNCTION() |
Oops, something went wrong.