Skip to content

Commit 9fe2967

Browse files
committed
Merge branch 'master' into cad_shaders_work
2 parents 8e80178 + 81aad96 commit 9fe2967

Some content is hidden

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

74 files changed

+2694
-1174
lines changed

.gitignore

Lines changed: 3 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,10 @@ 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

.gitmodules

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
[submodule "3rdparty/implot"]
9191
path = 3rdparty/implot
9292
url = git@github.com:Devsh-Graphics-Programming/implot.git
93-
[submodule "3rdparty/boost/preprocessor"]
94-
path = 3rdparty/boost/preprocessor
95-
url = git@github.com:Devsh-Graphics-Programming/preprocessor.git
93+
[submodule "tests"]
94+
path = tests
95+
url = git@github.com:Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework.git
96+
[submodule "3rdparty/boost/superproject"]
97+
path = 3rdparty/boost/superproject
98+
url = git@github.com:boostorg/boost.git

3rdparty/boost/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
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,8 @@ 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()
18+
endif()
19+
20+
set(BOOST_INCLUDE_LIBRARIES wave)
21+
set(BOOST_STAGEDIR "${CMAKE_CURRENT_BINARY_DIR}/boost/superproject/stage")
22+
add_subdirectory(superproject superproject EXCLUDE_FROM_ALL)

3rdparty/boost/preprocessor

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

3rdparty/boost/superproject

Submodule superproject added at 1c4d353

3rdparty/dxc/Readme.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# How to update the DXC module
2+
3+
## FIRST TIME SETUP: Make sure you have the correct remotes!
4+
5+
The following submodules as initialized on your system should have `origin` pointing at the `git@github.com:Devsh-Graphics-Programming` fork.
6+
7+
Then a remote `Khronos` for the SPIR-V submodules, and `Microsoft` for the DXC.
8+
9+
If they don't then you can correct that with `git remote add [RemoteName] git@github.com:[Organisation]/[Repo-Name].git` and `git remote remove [RemoteName]`
10+
11+
## IF YOU GET `There is no tracking information for the current branch`
12+
13+
just make the branch track the origin
14+
```
15+
git branch --set-upstream-to=origin/[BranchName] [BranchName]
16+
```
17+
18+
## Its Basically an Depth First Search with a Prologue and Epilogue
19+
20+
```
21+
checkout correct branch HEAD
22+
[optional] Merge latest stuff from original project
23+
recurse()
24+
commit
25+
push
26+
```
27+
28+
### First make sure you're on some Nabla branch Head
29+
30+
Just `git pull` and make sure you're tracking a branch.
31+
32+
### Make sure DXC is tracked and pointing at HEAD
33+
34+
```
35+
cd ./3rdparty/dxc/dxc
36+
git fetch
37+
git checkout devshFixes
38+
git pull
39+
```
40+
41+
### SPIR-V Headers: track & get latest head, merge latest upstream, commit and push
42+
43+
```
44+
cd ./external/SPIRV-Headers
45+
git fetch
46+
git checkout header_4_hlsl
47+
git pull
48+
git pull Khronos main
49+
git commit -m "latest Khronos `main` merge"
50+
git push
51+
```
52+
53+
### SPIR-V Tools: track & get latest head, merge latest upstream, commit and push
54+
55+
```
56+
cd ../SPIRV-Tools
57+
git fetch
58+
git checkout main
59+
git pull
60+
git pull Khronos main
61+
git commit -m "latest Khronos `main` merge"
62+
git push
63+
```
64+
65+
### Back to DXC and commit the submodule pointer changes
66+
67+
```
68+
cd ..
69+
git add .
70+
git commit -m "Update SPIR-V Headers and Tools"
71+
cd ..
72+
[optional] git pull Microsoft main
73+
[optional] git commit -m "merge upstream from Microsoft"
74+
git push
75+
```
76+
77+
The reason the upstream from Microsoft is optional is because it might break our Clang hacks like:
78+
- abuse of `__decltype`
79+
- `inout` working like a reference, but only sometimes
80+
- abuse of reference type
81+
82+
### Finally commit the change of DXC commit pointer to Nabla
83+
84+
```
85+
cd ..
86+
git add dxc
87+
git commit -m "Updated DXC"
88+
git push
89+
```

3rdparty/dxc/dxc

Submodule dxc updated 282 files

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
22
# This file is part of the "Nabla Engine".
33
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h
4+
45
cmake_minimum_required(VERSION 3.26)
5-
#policies
66
cmake_policy(SET CMP0112 NEW)
7-
#
7+
88
set(NBL_BUILD_ANDROID OFF)
99

1010
include(ExternalProject)
@@ -55,6 +55,7 @@ endif()
5555

5656
get_filename_component(NBL_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
5757
get_filename_component(NBL_ROOT_PATH_BINARY "${CMAKE_CURRENT_BINARY_DIR}" ABSOLUTE)
58+
get_filename_component(NBL_PYTHON_MODULE_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tests" ABSOLUTE)
5859
set(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH "${NBL_ROOT_PATH}/include")
5960
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NBL_ROOT_PATH}/cmake" CACHE PATH "")
6061

@@ -317,11 +318,15 @@ option(NBL_BUILD_BULLET "Enable Bullet Physics building and integration?" OFF)
317318

318319
option(NBL_BUILD_DOCS "Enable building documentation?" OFF) # No one has doxygen installed, plus we dont know when was the last time we generated working doxy and we'll use SphinX in the future
319320

321+
option(NBL_ENABLE_PROJECT_JSON_CONFIG_VALIDATION "" ON)
320322
option(NBL_EMBED_BUILTIN_RESOURCES "Embed built-in resources?" ON)
321323

322324
set(THIRD_PARTY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")
323325
set(THIRD_PARTY_BINARY_DIR "${PROJECT_BINARY_DIR}/3rdparty")
324326

327+
set(NBL_MEDIA_DIRECTORY "${PROJECT_SOURCE_DIR}/examples_tests/media")
328+
get_filename_component(NBL_MEDIA_DIRECTORY_ABS "${NBL_MEDIA_DIRECTORY}" ABSOLUTE)
329+
325330
option(NBL_UPDATE_GIT_SUBMODULE "Turn this ON to let CMake update all public submodules for you" ON)
326331
option(NBL_UPDATE_GIT_SUBMODULE_INCLUDE_PRIVATE "Turn this ON to attempt to update private Nabla submodules" OFF)
327332
find_package(Git REQUIRED)
@@ -332,6 +337,7 @@ NBL_UPDATE_SUBMODULES()
332337
add_subdirectory(${THIRD_PARTY_SOURCE_DIR})
333338

334339
add_subdirectory(src/nbl)
340+
add_subdirectory("${NBL_PYTHON_MODULE_ROOT_PATH}" tests) # Python Framework
335341

336342
if(NBL_BUILD_EXAMPLES)
337343
add_subdirectory(examples_tests)

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,41 @@ If you want to use git (without a submodule) then you can use `ExternalProject_A
344344

345345
I recommend you use `ExternalProject_Add` instead of `add_subdirectory` for **Nabla** as we haven't tested its use by *3rdparty* applications that use *CMake* to build themselves yet.
346346

347+
# Continuous integration
348+
349+
## Nabla Python Framework
350+
351+
### CPU & GPU local tests shipped with the repository
352+
353+
#### Description
354+
355+
***Nabla*** aims to implement full CPU & GPU tests used by our CI in-house infrastructure groovy pipelines in relocatable way allowing users to execute and debug the tests locally on their own devices as well. Each test is a Python module which part of it gets created with the CMake build system configuration. A test is defined and created as a module by
356+
357+
- top json configuration file
358+
- interface Python script
359+
360+
Top json configuration file contains run & build info, array of profiles and json inputs for a Python testing module. The file is processed and validated by CMake to create output profiles bound to the Python module. Single profile contains data used by the module to execute tests with and the implementation of the test is located in interface Python script - the script overrides common abstract interface defined as a integral part of Nabla Python framework module. The description is abstract and doesn't contain specific details, join our discord if you have any questions!
361+
362+
#### Development & Debug
363+
364+
Each valid Python module contains autogenerated .vscode's *launch.json* and *settings.json* to make development easy. You just need to `Open with Code`in the module's directory. Make sure to install [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) there to enable IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
365+
366+
A target for which Python module is available for testing lists a special Python Framework section located in its solution's project file structure (**Visual Studio only!**) containing Nabla Python Framework sources, target's interface Python script, autogenerated json profiles and autogenerated` __main__.py` module script. Unfortunately pure Visual Studio works so-so with Python (issues with search module paths defined as `searchPath` .pyproj's property, issues with IntelliSense and Debugging) - we encourage to use Visual Studio Code if you need to Debug an interface or develop it.
367+
368+
#### Runtime
369+
370+
##### Command line
371+
372+
To run all tests bound to a module with a command line you just need to execute `python3 -m <module_reference>`. You can also specify special arguments to have more control over the test execution, for more details see [template module script](https://github.com/Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework/blob/4f7a67a3fa9bb418bcb07fa2f7a5853e55b853c4/scripts/__main__.py.cmake)
373+
374+
##### Visual Studio
375+
376+
You need to open a target's solution. To launch all tests bound to a module a module's `__main__.py` file located in Python Framework section must be selected and `Debug -> Execute File in Python interactive` executed.
377+
378+
**Visual Studio Code**
379+
380+
You need to open module's directory as workspace with `Open with Code `, select `Run and Debug` icon, select `__main__.py` file and run it.
381+
347382
# Caveats and Particular Behaviour
348383

349384
## Hardcoded Caps

__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)