Skip to content

Commit 5a3bf2a

Browse files
committed
AMD Capsaicin Framework v1.2
1 parent d642e5d commit 5a3bf2a

File tree

249 files changed

+32695
-8468
lines changed

Some content is hidden

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

249 files changed

+32695
-8468
lines changed

.clang-format

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ AlignConsecutiveAssignments: Consecutive
88
AlignConsecutiveBitFields: Consecutive
99
AlignConsecutiveDeclarations: Consecutive
1010
AlignConsecutiveMacros: Consecutive
11+
#AlignConsecutiveShortCaseStatements: true
1112
AlignEscapedNewlines: Left
1213
AlignOperands: AlignAfterOperator
1314
AlignTrailingComments: true
1415
AllowAllArgumentsOnNextLine: true
1516
AllowAllConstructorInitializersOnNextLine: true
1617
AllowAllParametersOfDeclarationOnNextLine: true
18+
#AllowBreakBeforeNoexceptSpecifier: Never
1719
AllowShortBlocksOnASingleLine: Empty
1820
AllowShortCaseLabelsOnASingleLine: true
21+
#AllowShortCompoundRequirementOnASingleLine: true
1922
AllowShortFunctionsOnASingleLine: Inline
2023
AllowShortIfStatementsOnASingleLine: WithoutElse
2124
AllowShortLambdasOnASingleLine: Inline
@@ -45,13 +48,17 @@ BraceWrapping:
4548
SplitEmptyFunction: false
4649
SplitEmptyRecord: false
4750
SplitEmptyNamespace: false
51+
#BreakAdjacentStringLiterals: true
52+
BreakAfterAttributes: Never
53+
#BreakAfterReturnType: Automatic
4854
BreakBeforeBinaryOperators: NonAssignment
4955
BreakBeforeBraces: Custom
5056
BreakBeforeConceptDeclarations: true
5157
BreakBeforeTernaryOperators: true
5258
BreakConstructorInitializers: BeforeComma
5359
BreakInheritanceList: BeforeComma
5460
BreakStringLiterals: false
61+
#BreakTemplateDeclarations: Yes
5562
ColumnLimit: 110
5663
CompactNamespaces: false
5764
ConstructorInitializerIndentWidth: 4
@@ -77,12 +84,16 @@ IndentCaseLabels: false
7784
IndentExternBlock: NoIndent
7885
IndentGotoLabels: false
7986
IndentPPDirectives: AfterHash
80-
IndentRequires: false
87+
IndentRequiresClause: false
8188
IndentWidth: 4
8289
IndentWrappedFunctionNames: false
83-
#InsertTrailingCommas: Wrapped
90+
InsertBraces: true
91+
InsertNewlineAtEOF: true
92+
KeepEmptyLinesAtEOF: true
8493
KeepEmptyLinesAtTheStartOfBlocks: false
8594
LambdaBodyIndentation: Signature
95+
LineEnding: LF
96+
#MainIncludeChar: Quote
8697
MaxEmptyLinesToKeep: 1
8798
NamespaceIndentation: None
8899
PPIndentWidth: -1
@@ -92,8 +103,13 @@ QualifierAlignment: Custom
92103
QualifierOrder: ['inline', 'static', 'constexpr', 'volatile', 'type', 'restrict', 'const' ]
93104
ReferenceAlignment: Pointer
94105
ReflowComments: true
106+
RemoveParentheses: Leave
107+
RemoveSemicolon: true
108+
RequiresClausePosition: OwnLine
109+
RequiresExpressionIndentation: OuterScope
95110
SeparateDefinitionBlocks: Always
96111
ShortNamespaceLines: 0
112+
#SkipMacroDefinitionBody: false
97113
SortIncludes: true
98114
SortUsingDeclarations: true
99115
SpaceAfterCStyleCast: false
@@ -118,6 +134,7 @@ SpacesInContainerLiterals: false
118134
SpacesInLineCommentPrefix:
119135
Minimum: 1
120136
Maximum: 1
137+
SpacesInParens: Never
121138
SpacesInParentheses: false
122139
SpacesInSquareBrackets: false
123140
TabWidth: 4

.clang-tidy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Checks: 'bugprone-*,cert-*,clang-analyzer-*,cppcoreguidelines-*,hicpp-*,misc-*,modernize-*,performance-*,readability-*,-modernize-use-trailing-return-type,-portability-simd-intrinsics,-readability-function-size,-llvmlibc-implementation-in-namespace,-fuchsia-default-arguments-declarations,-fuchsia-default-arguments-calls,-llvmlibc-callee-namespace,-llvm-header-guard,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-owning-memory,-bugprone-easily-swappable-parameters,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,google-runtime-operator,google-upgrade-googletest-case,-hicpp-signed-bitwise,llvm-include-order,-readability-avoid-nested-conditional-operator,-readability-else-after-return,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-identifier-naming,-hicpp-avoid-c-arrays,-misc-include-cleaner,-readability-convert-member-functions-to-static,-bugprone-branch-clone,-cppcoreguidelines-init-variables,-modernize-avoid-c-arrays,-misc-const-correctness,-cppcoreguidelines-avoid-do-while,-hicpp-vararg,-readability-redundant-string-init,-hicpp-no-array-decay,-bugprone-exception-escape,-readability-identifier-naming,-misc-non-private-member-variables-in-classes,-clang-diagnostic-pragma-once-outside-header,-google-runtime-operator'
2+
FormatStyle: 'file'
3+
HeaderFileExtensions: ['h','hpp']
4+
ImplementationFileExtensions: ['cpp','inl']

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
[*.{c,c++,cc,config,cp,cpp,cu,cxx,h,hh,hpp,hxx,inc,inl]
2+
[*.{c,c++,cc,config,cp,cpp,cu,cxx,h,hh,hpp,hxx,inc,inl}]
33
indent_style=space
44
indent_size=4
55
tab_width=4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ build
33
imgui.ini
44
.vscode
55
.vs
6-
out
6+
out/
7+
cache/
8+
shader_cache/

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
[submodule "third_party/gfx"]
22
path = third_party/gfx
33
url = https://github.com/gboisse/gfx.git
4-
[submodule "third_party/CLI11"]
5-
path = third_party/CLI11
6-
url = https://github.com/CLIUtils/CLI11
7-
[submodule "assets/CapsaicinTestMedia"]
8-
path = assets/CapsaicinTestMedia
9-
url = https://github.com/GPUOpen-LibrariesAndSDKs/CapsaicinTestMedia.git

CMakeLists.txt

Lines changed: 75 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
cmake_minimum_required(VERSION 3.24.0)
1+
cmake_minimum_required(VERSION 3.25.0)
2+
cmake_policy(SET CMP0141 NEW)
23

34
project(Capsaicin
4-
VERSION 1.1.0
5+
LANGUAGES CXX
6+
VERSION 1.2.0
57
DESCRIPTION "AMD experimental real-time rendering framework designed for graphics research and development"
68
)
79

810
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
911

10-
# Set preprocessor definitions
11-
add_definitions(
12-
/MP
13-
)
14-
1512
# Disable unused parameters from 3rd party directories
1613
set(GFX_BUILD_EXAMPLES OFF CACHE BOOL "")
1714
set(BUILD_TESTING OFF CACHE BOOL "")
@@ -21,28 +18,80 @@ set(GFX_ENABLE_SCENE ON CACHE BOOL "")
2118
set(GFX_ENABLE_GUI ON CACHE BOOL "")
2219

2320
# Gather dependencies
21+
include(FetchContent)
2422
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/gfx EXCLUDE_FROM_ALL)
25-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/CLI11 EXCLUDE_FROM_ALL)
23+
set_target_properties(gfx PROPERTIES FOLDER "third_party")
2624
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
2725

28-
# Organize third party projects
29-
set_target_properties(uninstall PROPERTIES FOLDER "third_party")
30-
set_target_properties(gfx PROPERTIES FOLDER "third_party")
31-
set_target_properties(CLI11 PROPERTIES FOLDER "third_party")
32-
set_target_properties(tinyobjloader PROPERTIES FOLDER "third_party/gfx_deps")
33-
set_target_properties(tinyexr PROPERTIES FOLDER "third_party/gfx_deps")
34-
set_target_properties(ktx PROPERTIES FOLDER "third_party/gfx_deps")
35-
set_target_properties(astcenc-avx2-static PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
36-
set_target_properties(ktx_read PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
37-
set_target_properties(ktx_version PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
38-
set_target_properties(obj_basisu_cbind PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
39-
set_target_properties(objUtil PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
40-
41-
if(TARGET mkvk)
42-
set_target_properties(mkvk PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
43-
set_target_properties(makedfd2vk PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
44-
set_target_properties(makevk2dfd PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
45-
set_target_properties(mkvkformatfiles PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
26+
FetchContent_Declare(
27+
CLI11
28+
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
29+
GIT_TAG v2.4.2
30+
GIT_SHALLOW TRUE
31+
GIT_PROGRESS TRUE
32+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cli11/"
33+
FIND_PACKAGE_ARGS 2.0.0 NAMES CLI11
34+
)
35+
FetchContent_MakeAvailable(CLI11)
36+
if(NOT CLI11_FOUND)
37+
set_target_properties(CLI11 PROPERTIES FOLDER "third_party")
38+
endif()
39+
40+
FetchContent_Declare(
41+
yaml-cpp
42+
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
43+
GIT_TAG 0.8.0
44+
GIT_SHALLOW TRUE
45+
GIT_PROGRESS TRUE
46+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/yaml-cpp/"
47+
FIND_PACKAGE_ARGS 0.7.0 NAMES yaml-cpp
48+
)
49+
set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "")
50+
FetchContent_MakeAvailable(yaml-cpp)
51+
if(NOT yaml-cpp_FOUND)
52+
set_target_properties(yaml-cpp PROPERTIES FOLDER "third_party")
53+
endif()
54+
55+
FetchContent_Declare(
56+
nlohmann_json
57+
GIT_REPOSITORY https://github.com/nlohmann/json.git
58+
GIT_TAG v3.11.3
59+
GIT_SHALLOW TRUE
60+
GIT_PROGRESS TRUE
61+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/nlohmann_json/"
62+
FIND_PACKAGE_ARGS NAMES nlohmann_json
63+
)
64+
FetchContent_MakeAvailable(nlohmann_json)
65+
if(NOT nlohmann_json_FOUND)
66+
set_target_properties(nlohmann_json PROPERTIES FOLDER "third_party")
67+
endif()
68+
69+
FetchContent_Declare(
70+
meshoptimizer
71+
GIT_REPOSITORY https://github.com/zeux/meshoptimizer.git
72+
GIT_TAG v0.22
73+
GIT_SHALLOW TRUE
74+
GIT_PROGRESS TRUE
75+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/meshoptimizer/"
76+
FIND_PACKAGE_ARGS NAMES meshoptimizer
77+
)
78+
FetchContent_MakeAvailable(meshoptimizer)
79+
if(NOT meshoptimizer_FOUND)
80+
set_target_properties(meshoptimizer PROPERTIES FOLDER "third_party")
81+
add_library(meshoptimizer::meshoptimizer ALIAS meshoptimizer)
82+
endif()
83+
84+
option(CAPSAICIN_DOWNLOAD_TEST_MEDIA "Download test media scenes" ON)
85+
if(CAPSAICIN_DOWNLOAD_TEST_MEDIA)
86+
FetchContent_Declare(
87+
CapsaicinTestMedia
88+
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/CapsaicinTestMedia.git
89+
GIT_TAG v1.2
90+
GIT_SHALLOW TRUE
91+
GIT_PROGRESS TRUE
92+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets/CapsaicinTestMedia/"
93+
)
94+
FetchContent_MakeAvailable(CapsaicinTestMedia)
4695
endif()
4796

4897
# Set project output directory variables.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright © 2023 Advanced Micro Devices, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files(the “Software”), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions :
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Features:
1111
- Inbuilt user extensible UI
1212
- Automated debugging and profiling information
1313
- Pluggable and swappable common rendering techniques such as ToneMapping, TAA, AO etc.
14-
- Unbiased reference path tracer
14+
- Reference path tracer
1515

1616
![Capsaicin](docs/images/scene_viewer.png)
1717

@@ -35,40 +35,46 @@ Furthermore the technique can estimate direct lighting through its probe system
3535

3636
- Direct3D12 capable hardware and OS (Windows 10 20H2 or newer)
3737
- [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/) or newer
38-
- CMake 3.10 or newer (can use Visual Studio, VSCode or any other CMake supported IDE)
38+
- CMake 3.24 or newer (can use Visual Studio, VSCode or any other CMake supported IDE)
3939
- DirectX Raytracing capable GPU and compatible drivers
4040

4141
## Building
4242

43-
Capsaicin uses submodules to include any required dependencies beyond those listed in **Prerequisites**.
43+
Capsaicin uses submodules to include any essential dependencies.
44+
45+
The following submodules are required:
46+
- gfx: Contains gfx D3D12 abstraction library (located in "third_party/" subfolder
4447

4548
When acquiring the code make sure to clone the repo with submodules included:
4649

47-
`git clone --recurse-submodules https://github.com/GPUOpen-LibrariesAndSDKs/Capsaicin`
50+
`git clone --recurse-submodules https://github.com/Radeon-Pro/Capsaicin`
4851

4952
If you have already cloned this repo without submodules, then use:
5053

5154
`git submodule update --init --recursive`
5255

5356
Capsaicin uses the [CMake](https://cmake.org/) build system. See the [Getting Started](./docs/development/getting_started.md) section for more information.
5457

58+
Additional third party resources used by Capsaicin will be acquired using CMakes inbuilt FetchContent functionality during CMake configuration. See the [Getting Started](./docs/development/getting_started.md) section for a list of used dependencies and how they are retrieved.
59+
5560
## Resources
5661

5762
- [Documentation](./docs/index.md)
5863
- [Getting Started](./docs/development/getting_started.md)
5964
- [Architecture](./docs/development/architecture.md)
65+
- [Usage](./docs/usage/scene_viewer_usage.md)
6066

6167
## Citation
6268

63-
If Capsaicin is used in any published work, please ensure to cite it using:
69+
If Capsaicin is used in any published work, ensure to cite it using:
6470

6571
```bibtex
6672
@Misc{Capsaicin23,
6773
author = {Boissé, Guillaume and Oliver, Matthew and Meunier, Sylvain and Dupont de Dinechin, Héloïse and Eto, Kenta},
6874
title = {The {AMD Capsaicin Framework}},
6975
year = {2023},
7076
month = {8},
71-
url = {https://github.com/GPUOpen-LibrariesAndSDKs/Capsaicin},
77+
url = {https://github.com/Radeon-Pro/Capsaicin_Open},
7278
}
7379
```
7480

assets/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CapsaicinTestMedia/

assets/CapsaicinTestMedia

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

0 commit comments

Comments
 (0)