Skip to content

Commit c21012a

Browse files
Merge branch 'blit' into blit_hlsl_port
2 parents f47fcc7 + 6b96a1b commit c21012a

File tree

893 files changed

+262371
-1516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

893 files changed

+262371
-1516
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*.ilk
1414
*.pdb
1515
*_d.exe
16-
# CEGUI's downloaded dependencies on Windows
17-
3rdparty/CEGUI/cegui-deps-0.8.x-src.zip
1816
# usually where people build
1917
android_build/*
2018
build*/*
@@ -23,9 +21,11 @@ install/*
2321
# legacy temporary and output directories
2422
lib/*
2523
doctemp/*
26-
source/obj
27-
source/Irrlicht/libIrrlichtServer.a
2824
# stuff output by examples
2925
examples_tests/*
3026
examples_tests/tmp/*
3127
android-sample/bin/*
28+
# shader debug sideeffects
29+
preprocessed.hlsl
30+
compiled.spv
31+
.vs/*

.gitmodules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
[submodule "3rdparty/libjpeg-turbo"]
2525
path = 3rdparty/libjpeg-turbo
2626
url = [email protected]:Devsh-Graphics-Programming/libjpeg-turbo.git
27-
[submodule "3rdparty/bullet3"]
28-
path = 3rdparty/bullet3
29-
url = [email protected]:Devsh-Graphics-Programming/bullet3.git
3027
[submodule "3rdparty/portable-file-dialogs"]
3128
path = 3rdparty/portable-file-dialogs
3229
url = [email protected]:Devsh-Graphics-Programming/portable-file-dialogs.git
@@ -90,6 +87,9 @@
9087
[submodule "3rdparty/implot"]
9188
path = 3rdparty/implot
9289
url = [email protected]:Devsh-Graphics-Programming/implot.git
93-
[submodule "3rdparty/boost/preprocessor"]
94-
path = 3rdparty/boost/preprocessor
95-
url = [email protected]:Devsh-Graphics-Programming/preprocessor.git
90+
[submodule "tests"]
91+
path = tests
92+
url = [email protected]:Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework.git
93+
[submodule "3rdparty/boost/superproject"]
94+
path = 3rdparty/boost/superproject
95+
url = [email protected]:boostorg/boost.git

3rdparty/CMakeLists.txt

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,34 @@ add_subdirectory(libpng libpng EXCLUDE_FROM_ALL)
160160
add_dependencies(png_static zlibstatic)
161161

162162

163-
#openexr
163+
# OpenEXR
164164
option(_NBL_COMPILE_WITH_OPEN_EXR_ "Build with OpenEXR library" ON)
165-
if (_NBL_COMPILE_WITH_OPEN_EXR_)
166-
set(_OLD_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
167-
set(_OLD_BUILD_STATIC_LIBS ${BUILD_STATIC_LIBS})
168-
set(_OLD_BUILD_TESTING ${BUILD_TESTING})
169-
set(BUILD_SHARED_LIBS OFF)
170-
set(BUILD_STATIC_LIBS OFF)
171-
set(BUILD_TESTING OFF)
172-
set(PYILMBASE_ENABLE OFF CACHE STRING "" FORCE)
173-
set(OPENEXR_BUILD_UTILS OFF CACHE STRING "" FORCE)
174-
set(OPENEXR_VIEWERS_ENABLE OFF CACHE STRING "" FORCE)
175-
add_subdirectory(openexr openexr EXCLUDE_FROM_ALL)
176-
set(BUILD_SHARED_LIBS ${_OLD_BUILD_SHARED_LIBS})
177-
set(BUILD_STATIC_LIBS ${_OLD_BUILD_STATIC_LIBS})
178-
set(BUILD_TESTING ${_OLD_BUILD_TESTING})
179-
endif()
180165

166+
# Note we are adding it anyway regardless _NBL_COMPILE_WITH_OPEN_EXR_, its because we need Half dependecy
167+
# it generates on fly in its build directory which doesnt have to be linked (class with inline methods),
168+
# here is where _NBL_COMPILE_WITH_OPEN_EXR_ plays a role - when disabled OpenEXR won't be built and linked
169+
# but it's core
170+
171+
set(_OLD_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
172+
set(_OLD_BUILD_STATIC_LIBS ${BUILD_STATIC_LIBS})
173+
set(_OLD_BUILD_TESTING ${BUILD_TESTING})
174+
set(BUILD_SHARED_LIBS OFF)
175+
set(BUILD_STATIC_LIBS OFF)
176+
set(BUILD_TESTING OFF)
177+
set(PYILMBASE_ENABLE OFF CACHE STRING "" FORCE)
178+
set(OPENEXR_BUILD_UTILS OFF CACHE STRING "" FORCE)
179+
set(OPENEXR_FORCE_INTERNAL_IMATH ON CACHE STRING "" FORCE) # TODO: make it a submodule and force using it maybe instead of letting OpenEXR download it from it's github repository
180+
set(OPENEXR_BUILD_TOOLS OFF CACHE STRING "" FORCE)
181+
set(OPENEXR_INSTALL OFF CACHE STRING "" FORCE)
182+
set(OPENEXR_INSTALL_DOCS OFF CACHE STRING "" FORCE)
183+
set(OPENEXR_INSTALL_EXAMPLES OFF CACHE STRING "" FORCE)
184+
set(OPENEXR_INSTALL_PKG_CONFIG OFF CACHE STRING "" FORCE)
185+
set(OPENEXR_INSTALL_TOOLS OFF CACHE STRING "" FORCE)
186+
187+
add_subdirectory(openexr openexr EXCLUDE_FROM_ALL)
188+
set(BUILD_SHARED_LIBS ${_OLD_BUILD_SHARED_LIBS})
189+
set(BUILD_STATIC_LIBS ${_OLD_BUILD_STATIC_LIBS})
190+
set(BUILD_TESTING ${_OLD_BUILD_TESTING})
181191

182192
#gli
183193
option(_NBL_COMPILE_WITH_GLI_ "Build with GLI library" ON)
@@ -194,10 +204,6 @@ if(_NBL_COMPILE_WITH_GLI_)
194204
set(BUILD_TESTING ${_OLD_BUILD_TESTING})
195205
endif()
196206

197-
198-
nbl_adjust_flags()
199-
200-
201207
add_library(lzma OBJECT
202208
lzma/C/Alloc.c
203209
lzma/C/LzFind.c
@@ -295,12 +301,7 @@ option(GLM_TEST_ENABLE "Build unit tests" OFF)
295301
set(BUILD_SHARED_LIBS ${_OLD_BUILD_SHARED_LIBS})
296302
set(BUILD_STATIC_LIBS ${_OLD_BUILD_STATIC_LIBS})
297303

298-
299304
if (NBL_BUILD_MITSUBA_LOADER)
300-
if(NBL_UPDATE_GIT_SUBMODULE)
301-
update_git_submodule(./libexpat)
302-
endif()
303-
304305
option(BUILD_tools "EXPAT: build the xmlwf tool for expat library" OFF)
305306
option(BUILD_examples "EXPAT: build the examples for expat library" OFF)
306307
option(BUILD_tests "EXPAT: build the tests for expat library" OFF)
@@ -321,26 +322,14 @@ if (NBL_BUILD_MITSUBA_LOADER)
321322
set(MITSUBA_LOADER_DEPENDENT_LIBS ${MITSUBA_LOADER_DEPENDENT_LIBS} PARENT_SCOPE)
322323
endif()
323324

324-
325325
if (NBL_BUILD_BULLET)
326-
if(NBL_UPDATE_GIT_SUBMODULE)
327-
update_git_submodule(./bullet3)
328-
endif()
329326
set(BULLET_INCLUDE_PATH
330327
${CMAKE_CURRENT_SOURCE_DIR}/bullet3/src
331328
)
332329

333330
set(BULLET_INCLUDE_PATH ${BULLET_INCLUDE_PATH} PARENT_SCOPE)
334331
endif()
335332

336-
337-
if (NBL_COMPILE_WITH_CUDA)
338-
if(NBL_UPDATE_GIT_SUBMODULE)
339-
update_git_submodule(./jitify)
340-
endif()
341-
endif()
342-
343-
344333
# Final gather
345334
set(NBL_3RDPARTY_TARGETS
346335
lzma
@@ -361,18 +350,16 @@ set(NBL_3RDPARTY_TARGETS
361350
GenericCodeGen
362351
SPIRV
363352
SPIRV-Tools-static # SPIRV-Tools-shared in case of SHARED lib
364-
SPIRV-Tools-opt
353+
SPIRV-Tools-opt
354+
Imath
355+
OpenEXRCore
356+
${NBL_BOOST_TARGETS}
365357
)
366358
if (_NBL_COMPILE_WITH_OPEN_EXR_)
367359
list(APPEND NBL_3RDPARTY_TARGETS
368-
IlmBaseConfig
369-
IlmImfConfig
370-
Imath
371-
IlmThread
372-
IlmImf
373-
Half
360+
OpenEXR
374361
Iex
375-
IexMath
362+
IlmThread
376363
)
377364
endif()
378365
if(ANDROID AND NOT ${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
@@ -397,11 +384,17 @@ foreach(trgt IN LISTS NBL_3RDPARTY_TARGETS)
397384
else()
398385
set_property(TARGET ${trgt} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
399386
endif()
387+
388+
if(MSVC AND NBL_SANITIZE_ADDRESS)
389+
set_property(TARGET ${trgt} PROPERTY COMPILE_OPTIONS /fsanitize=address)
390+
endif()
400391
endforeach()
401392

402393
add_custom_target(3rdparty)
403394
add_dependencies(3rdparty ${NBL_3RDPARTY_TARGETS})
404395

396+
nbl_adjust_flags()
397+
405398
set(_NBL_3RDPARTY_TARGETS_ ${NBL_3RDPARTY_TARGETS} PARENT_SCOPE)
406399

407400
## REMINDER / NOTE : This is how we install 3rdparty headers we need !

3rdparty/boost/CMakeLists.txt

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(BOOST_PREPROCESSOR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/preprocessor/include" CACHE PATH "" FORCE)
1+
set(BOOST_PREPROCESSOR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/superproject/libs/preprocessor/include" CACHE PATH "" FORCE)
22

33
get_filename_component(_BOOST_PREPROCESSOR_BR_BUNDLE_SEARCH_DIRECTORY_ "${BOOST_PREPROCESSOR_INCLUDE}" ABSOLUTE)
44
get_filename_component(_BOOST_PREPROCESSOR_BR_OUTPUT_DIRECTORY_SOURCE_ "${CMAKE_CURRENT_BINARY_DIR}/src" ABSOLUTE)
@@ -15,4 +15,72 @@ if(NBL_EMBED_BUILTIN_RESOURCES)
1515
endforeach()
1616

1717
ADD_CUSTOM_BUILTIN_RESOURCES(boostBuiltinResourceData BOOST_RESOURCES_TO_EMBED "${_BOOST_PREPROCESSOR_BR_BUNDLE_SEARCH_DIRECTORY_}" "boost" "boost::builtin" "${_BOOST_PREPROCESSOR_BR_OUTPUT_DIRECTORY_HEADER_}" "${_BOOST_PREPROCESSOR_BR_OUTPUT_DIRECTORY_HEADER_}" "STATIC" "INTERNAL")
18+
endif()
19+
20+
get_filename_component(NBL_BOOST_WAVE_DEP_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dep/wave.cmake" ABSOLUTE)
21+
22+
if(NOT EXISTS "${NBL_BOOST_WAVE_DEP_FILE}")
23+
message(FATAL_ERROR "Internal error, generate NBL_BOOST_WAVE_DEP_FILE by enabling NBL_BOOST_GENERATE_DEP_LIST!")
24+
endif()
25+
26+
set(BOOST_STAGEDIR "${CMAKE_CURRENT_BINARY_DIR}/boost/superproject/stage")
27+
include("${NBL_BOOST_WAVE_DEP_FILE}")
28+
29+
foreach(BOOST_LIB IN LISTS NBL_BOOST_LIBS)
30+
add_subdirectory(superproject/libs/${BOOST_LIB} EXCLUDE_FROM_ALL)
31+
endforeach()
32+
33+
add_subdirectory(superproject/libs/wave EXCLUDE_FROM_ALL)
34+
35+
foreach(BOOST_LIB IN LISTS NBL_BOOST_LIBS)
36+
if(TARGET boost_${BOOST_LIB})
37+
list(APPEND NBL_BOOST_TARGETS boost_${BOOST_LIB})
38+
endif()
39+
endforeach()
40+
41+
set(NBL_BOOST_TARGETS
42+
${NBL_BOOST_TARGETS}
43+
PARENT_SCOPE)
44+
45+
# Boost uses it's own tool for generating dependency list for targets, therefore we
46+
# can make sure manually added dependnecy subdirectories for a library are valid
47+
# https://www.boost.org/doc/libs/1_83_0/tools/boostdep/doc/html/index.html#boostdep.introduction.building_boostdep
48+
49+
if(NBL_BOOST_GENERATE_DEP_LIST) # internal, for Nabla devs
50+
if(WIN32)
51+
set(NBL_BOOSTDEP_EXE "boostdep.exe")
52+
else()
53+
set(NBL_BOOSTDEP_EXE "boostdep")
54+
endif()
55+
56+
set(NBL_BOOSTDEP_EXE_FILEPATH "${CMAKE_CURRENT_BINARY_DIR}/superproject/tools/boostdep/bin/${NBL_BOOSTDEP_EXE}")
57+
58+
if(NOT EXISTS "${NBL_BOOSTDEP_EXE_FILEPATH}")
59+
macro(NBL_BOOST_EXECUTE)
60+
execute_process(COMMAND ${ARGV}
61+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/superproject"
62+
)
63+
endmacro()
64+
65+
NBL_BOOST_EXECUTE(cmd /C bootstrap.bat)
66+
NBL_BOOST_EXECUTE(cmd /C b2.exe tools/boostdep/build)
67+
NBL_BOOST_EXECUTE("${CMAKE_COMMAND}" -E copy "./dist/bin/${NBL_BOOSTDEP_EXE}" "${NBL_BOOSTDEP_EXE_FILEPATH}")
68+
NBL_BOOST_EXECUTE(git clean -fdx)
69+
NBL_BOOST_EXECUTE(git reset --hard)
70+
endif()
71+
72+
execute_process(COMMAND "${NBL_BOOSTDEP_EXE_FILEPATH}" --boost-root "${CMAKE_CURRENT_SOURCE_DIR}/superproject" --brief wave
73+
OUTPUT_VARIABLE NBL_OUTPUT_VAR
74+
)
75+
76+
file(WRITE "${NBL_BOOST_WAVE_DEP_FILE}" "${NBL_OUTPUT_VAR}")
77+
78+
file(STRINGS "${NBL_BOOST_WAVE_DEP_FILE}" NBL_BOOST_LIBS)
79+
set(NBL_BOOST_LIBS ${NBL_BOOST_LIBS})
80+
list(POP_FRONT NBL_BOOST_LIBS)
81+
list(FILTER NBL_BOOST_LIBS EXCLUDE REGEX "#")
82+
list(FILTER NBL_BOOST_LIBS EXCLUDE REGEX "(unknown)")
83+
string(REPLACE "~" "/" NBL_BOOST_LIBS "${NBL_BOOST_LIBS}")
84+
85+
file(WRITE "${NBL_BOOST_WAVE_DEP_FILE}" "set(NBL_BOOST_LIBS ${NBL_BOOST_LIBS})")
1886
endif()

3rdparty/boost/dep/wave.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(NBL_BOOST_LIBS assert;concept_check;config;core;filesystem;format;iterator;lexical_cast;mpl;multi_index;optional;pool;preprocessor;serialization;smart_ptr;spirit;static_assert;throw_exception;type_traits;atomic;container_hash;detail;io;predef;system;winapi;utility;conversion;function_types;fusion;container;integer;numeric/conversion;bind;move;tuple;array;function;mp11;variant;variant2;endian;phoenix;proto;range;regex;thread;typeof;unordered;align;intrusive;describe;functional;chrono;date_time;exception;type_index;ratio;algorithm;tokenizer)

3rdparty/boost/preprocessor

Lines changed: 0 additions & 1 deletion
This file was deleted.

3rdparty/boost/superproject

Submodule superproject added at 1c4d353

3rdparty/bullet3

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
Bullet Continuous Collision Detection and Physics Library
3+
Copyright (c) 2003-2013 Erwin Coumans http://bulletphysics.org
4+
5+
This software is provided 'as-is', without any express or implied warranty.
6+
In no event will the authors be held liable for any damages arising from the use of this software.
7+
Permission is granted to anyone to use this software for any purpose,
8+
including commercial applications, and to alter it and redistribute it freely,
9+
subject to the following restrictions:
10+
11+
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12+
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13+
3. This notice may not be removed or altered from any source distribution.
14+
*/
15+
16+
#ifndef B3_BROADPHASE_CALLBACK_H
17+
#define B3_BROADPHASE_CALLBACK_H
18+
19+
#include "Bullet3Common/b3Vector3.h"
20+
struct b3BroadphaseProxy;
21+
22+
struct b3BroadphaseAabbCallback
23+
{
24+
virtual ~b3BroadphaseAabbCallback() {}
25+
virtual bool process(const b3BroadphaseProxy* proxy) = 0;
26+
};
27+
28+
struct b3BroadphaseRayCallback : public b3BroadphaseAabbCallback
29+
{
30+
///added some cached data to accelerate ray-AABB tests
31+
b3Vector3 m_rayDirectionInverse;
32+
unsigned int m_signs[3];
33+
b3Scalar m_lambda_max;
34+
35+
virtual ~b3BroadphaseRayCallback() {}
36+
};
37+
38+
#endif //B3_BROADPHASE_CALLBACK_H

0 commit comments

Comments
 (0)