Skip to content

Commit 7e3beea

Browse files
committed
AMD Capsaicin Framework v1.0
0 parents  commit 7e3beea

File tree

155 files changed

+27941
-0
lines changed

Some content is hidden

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

155 files changed

+27941
-0
lines changed

.clang-format

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
Language: Cpp
3+
Standard: Latest
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignArrayOfStructures: Right
7+
AlignConsecutiveAssignments: Consecutive
8+
AlignConsecutiveBitFields: Consecutive
9+
AlignConsecutiveDeclarations: Consecutive
10+
AlignConsecutiveMacros: Consecutive
11+
AlignEscapedNewlines: Left
12+
AlignOperands: AlignAfterOperator
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: true
17+
AllowShortBlocksOnASingleLine: Empty
18+
AllowShortCaseLabelsOnASingleLine: true
19+
AllowShortFunctionsOnASingleLine: Inline
20+
AllowShortIfStatementsOnASingleLine: WithoutElse
21+
AllowShortLambdasOnASingleLine: Inline
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: Yes
27+
BinPackArguments: true
28+
BinPackParameters: true
29+
BitFieldColonSpacing: Both
30+
BraceWrapping:
31+
AfterCaseLabel: true
32+
AfterClass: true
33+
AfterControlStatement: Always
34+
AfterEnum: true
35+
AfterFunction: true
36+
AfterNamespace: true
37+
AfterStruct: true
38+
AfterUnion: true
39+
AfterExternBlock: true
40+
BeforeCatch: true
41+
BeforeElse: true
42+
BeforeLambdaBody: false
43+
BeforeWhile: true
44+
IndentBraces: false
45+
SplitEmptyFunction: false
46+
SplitEmptyRecord: false
47+
SplitEmptyNamespace: false
48+
BreakBeforeBinaryOperators: NonAssignment
49+
BreakBeforeBraces: Custom
50+
BreakBeforeConceptDeclarations: true
51+
BreakBeforeTernaryOperators: true
52+
BreakConstructorInitializers: BeforeComma
53+
BreakInheritanceList: BeforeComma
54+
BreakStringLiterals: false
55+
ColumnLimit: 110
56+
CompactNamespaces: false
57+
ConstructorInitializerIndentWidth: 4
58+
ContinuationIndentWidth: 4
59+
Cpp11BracedListStyle: true
60+
DeriveLineEnding: false
61+
DerivePointerAlignment: false
62+
DisableFormat: false
63+
EmptyLineAfterAccessModifier: Never
64+
EmptyLineBeforeAccessModifier: Always
65+
ExperimentalAutoDetectBinPacking: false
66+
FixNamespaceComments: true
67+
IncludeBlocks: Regroup
68+
IncludeCategories:
69+
- Regex: '^"'
70+
Priority: 1
71+
- Regex: '^<'
72+
Priority: 2
73+
IncludeIsMainSourceRegex: '(.inl)$'
74+
IndentAccessModifiers: false
75+
IndentCaseBlocks: false
76+
IndentCaseLabels: false
77+
IndentExternBlock: NoIndent
78+
IndentGotoLabels: false
79+
IndentPPDirectives: AfterHash
80+
IndentRequires: false
81+
IndentWidth: 4
82+
IndentWrappedFunctionNames: false
83+
#InsertTrailingCommas: Wrapped
84+
KeepEmptyLinesAtTheStartOfBlocks: false
85+
LambdaBodyIndentation: Signature
86+
MaxEmptyLinesToKeep: 1
87+
NamespaceIndentation: None
88+
PPIndentWidth: -1
89+
PackConstructorInitializers: Never
90+
PointerAlignment: Right
91+
QualifierAlignment: Custom
92+
QualifierOrder: ['inline', 'static', 'constexpr', 'volatile', 'type', 'restrict', 'const' ]
93+
ReferenceAlignment: Pointer
94+
ReflowComments: true
95+
SeparateDefinitionBlocks: Always
96+
ShortNamespaceLines: 0
97+
SortIncludes: true
98+
SortUsingDeclarations: true
99+
SpaceAfterCStyleCast: false
100+
SpaceAfterLogicalNot: false
101+
SpaceAfterTemplateKeyword: false
102+
SpaceAroundPointerQualifiers: Default
103+
SpaceBeforeAssignmentOperators: true
104+
SpaceBeforeCaseColon: false
105+
SpaceBeforeCpp11BracedList: true
106+
SpaceBeforeCtorInitializerColon: true
107+
SpaceBeforeInheritanceColon: true
108+
SpaceBeforeParens: ControlStatements
109+
SpaceBeforeRangeBasedForLoopColon: true
110+
SpaceBeforeSquareBrackets: false
111+
SpaceInEmptyBlock: false
112+
SpaceInEmptyParentheses: false
113+
SpacesBeforeTrailingComments: 1
114+
SpacesInAngles: false
115+
SpacesInCStyleCastParentheses: false
116+
SpacesInConditionalStatement: false
117+
SpacesInContainerLiterals: false
118+
SpacesInLineCommentPrefix:
119+
Minimum: 1
120+
Maximum: 1
121+
SpacesInParentheses: false
122+
SpacesInSquareBrackets: false
123+
TabWidth: 4
124+
UseCRLF: false
125+
UseTab: Never
126+
...
127+

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
[*.{c,c++,cc,config,cp,cpp,cu,cxx,h,hh,hpp,hxx,inc,inl]
3+
indent_style=space
4+
indent_size=4
5+
tab_width=4
6+
7+
[*]
8+
9+
# Standard properties
10+
end_of_line=lf
11+
insert_final_newline=true
12+
max_line_length=120

.gitattributes

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
* text eol=lf
2+
3+
# Documents
4+
*.docx diff=astextplain
5+
*.pdf diff=astextplain
6+
*.md text diff=markdown
7+
8+
# Graphics
9+
*.png binary
10+
*.jpg binary
11+
*.jpeg binary
12+
*.gif binary
13+
*.tif binary
14+
*.tiff binary
15+
*.ico binary
16+
*.exr binary
17+
18+
# Scripts
19+
*.bat text eol=crlf
20+
*.cmd text eol=crlf
21+
*.ps1 text eol=crlf
22+
23+
# Archives
24+
*.7z binary
25+
*.gz binary
26+
*.tar binary
27+
*.tgz binary
28+
*.zip binary
29+
30+
# Sources
31+
*.c text diff=cpp
32+
*.cc text diff=cpp
33+
*.cxx text diff=cpp
34+
*.cpp text diff=cpp
35+
*.c++ text diff=cpp
36+
*.hpp text diff=cpp
37+
*.h text diff=cpp
38+
*.h++ text diff=cpp
39+
*.hh text diff=cpp
40+
*.inl text diff=cpp
41+
42+
# Compiled Object files
43+
*.slo binary
44+
*.lo binary
45+
*.o binary
46+
*.obj binary
47+
48+
# Precompiled Headers
49+
*.gch binary
50+
*.pch binary
51+
52+
# Compiled Dynamic libraries
53+
*.so binary
54+
*.dylib binary
55+
*.dll binary
56+
57+
# Compiled Static libraries
58+
*.lai binary
59+
*.la binary
60+
*.a binary
61+
*.lib binary
62+
63+
# Executables
64+
*.exe binary
65+
*.out binary
66+
*.app binary
67+
68+
# Program Data Base
69+
*.pdb binary

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
.DS_Store
3+
imgui.ini
4+
.vscode

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[submodule "third_party/gfx"]
2+
path = third_party/gfx
3+
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 "third_party/tinyexr"]
8+
path = third_party/tinyexr
9+
url = https://github.com/syoyo/tinyexr
10+
[submodule "third_party/miniz"]
11+
path = third_party/miniz
12+
url = https://github.com/richgel999/miniz.git
13+
[submodule "assets/CapsaicinTestMedia"]
14+
path = assets/CapsaicinTestMedia
15+
url = ../CapsaicinTestMedia.git

CMakeLists.txt

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
cmake_minimum_required(VERSION 3.10.0)
2+
3+
project(Capsaicin
4+
VERSION 1.0.0
5+
DESCRIPTION "AMD experimental real-time rendering framework designed for graphics research and development"
6+
)
7+
8+
set(GFX_BUILD_EXAMPLES OFF CACHE BOOL "Build gfx examples")
9+
set(TINYGLTF_BUILD_LOADER_EXAMPLE OFF CACHE BOOL "Build loader_example")
10+
11+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
12+
13+
# Set preprocessor definitions
14+
add_definitions(/MP
15+
-D_HAS_ITERATOR_DEBUGGING=0
16+
)
17+
18+
# Gather dependencies
19+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/gfx)
20+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/CLI11)
21+
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
22+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/miniz)
23+
24+
# Set linker flags
25+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
26+
27+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
28+
29+
# Organize third party projects
30+
set_target_properties(uninstall PROPERTIES FOLDER "third_party")
31+
set_target_properties(miniz PROPERTIES FOLDER "third_party")
32+
set_target_properties(gfx PROPERTIES FOLDER "third_party")
33+
set_target_properties(CLI11 PROPERTIES FOLDER "third_party")
34+
set_target_properties(tinyobjloader PROPERTIES FOLDER "third_party/gfx_deps")
35+
set_target_properties(ktx PROPERTIES FOLDER "third_party/gfx_deps")
36+
set_target_properties(astcenc-avx2-static PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
37+
set_target_properties(ktx_read PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
38+
set_target_properties(ktx_version PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
39+
set_target_properties(obj_basisu_cbind PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
40+
set_target_properties(objUtil PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
41+
42+
if(TARGET mkvk)
43+
set_target_properties(mkvk PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
44+
set_target_properties(makedfd2vk PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
45+
set_target_properties(makevk2dfd PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
46+
set_target_properties(mkvkformatfiles PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
47+
endif()
48+
49+
# Set project output directory variables.
50+
IF(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
51+
SET(CAPSAICIN_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE STRING "Path for runtime output files")
52+
ELSE()
53+
SET(CAPSAICIN_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE STRING "Path for runtime output files")
54+
ENDIF()
55+
56+
IF(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
57+
SET(CAPSAICIN_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE STRING "Path for library output files")
58+
ELSE()
59+
SET(CAPSAICIN_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE STRING "Path for library output files")
60+
ENDIF()
61+
62+
IF(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
63+
SET(CAPSAICIN_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib" CACHE STRING "Path for archive output files")
64+
ELSE()
65+
SET(CAPSAICIN_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} CACHE STRING "Path for archive output files")
66+
ENDIF()
67+
68+
# Build Capsaicin
69+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
70+
71+
# Set up startup project
72+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
73+
PROPERTY VS_STARTUP_PROJECT scene_viewer)
74+
75+
# Install assets and shaders directories
76+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION . FILES_MATCHING PATTERN "*.*")
77+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/core/shaders DESTINATION src/core FILES_MATCHING PATTERN "*.*")
78+
79+
# Configure CPack
80+
set(CPACK_GENERATOR "ZIP")
81+
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}")
82+
include(CPack)

LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
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.

0 commit comments

Comments
 (0)