Skip to content

Commit 5f20394

Browse files
committed
Add source code for RRA V1.0 release.
1 parent 880357e commit 5f20394

File tree

459 files changed

+69365
-2
lines changed

Some content is hidden

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

459 files changed

+69365
-2
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*~
2+
*.pyc
3+
*.orig
4+
__pycache__/
5+
build/linux
6+
build/mac
7+
build/win
8+
documentation/build
9+
documentation/source/_build
10+
external
11+
.vscode
12+
*.aps

BUILD.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
## Build instructions
2+
3+
### Download Source code
4+
5+
Clone the project radeon_raytracing_analyzer from github.com
6+
7+
git clone https://github.com/GPUOpen-Tools/radeon_raytracing_analyzer.git
8+
9+
### Building on Windows
10+
As a preliminary step, make sure that you have the following installed on your system:
11+
* CMake 3.11 or above.
12+
* Python 3.7 or above.
13+
* Qt® 5 or above (5.15.2 is the default and recommended).
14+
* Visual Studio® 2015 or above (2019 is the default).
15+
16+
Qt V5.15.2 can be installed using the Qt online installer available from the Qt 5.15.2 release page here: https://www.qt.io/blog/qt-5.15.2-released
17+
As an alternative, the Qt 5.12.6 offline installer can be used here: https://download.qt.io/archive/qt/5.12/5.12.6/
18+
Qt should be installed to the default location (C:\Qt\Qt5.xx.x).
19+
Be sure to select msvc2017/msvc2019 64-bit during Qt installation, depending on the compiler you decide to use.
20+
A reboot is required after Qt is installed.
21+
22+
CMake can be downloaded from (https://cmake.org/download/).
23+
Python (V3.x) can be downloaded from (https://www.python.org/). To build the documentation from Visual Studio, the Sphinx Python Document Generator is needed.
24+
This can be installed once Python is installed, as follows:
25+
* Open a command prompt and navigate to the scripts folder in the python install folder. Then type these 2 commands:
26+
* pip install -U sphinx
27+
* pip install sphinx_rtd_theme
28+
29+
Run the python pre_build.py script in the build folder from a command prompt. If no command line options are provided, the defaults will be used (Qt 5.15.2 and Visual Studio 2019)
30+
31+
Some useful options of the pre_build.py script:
32+
* --vs <Visual Studio version>: generate the solution files for a specific Visual Studio version. For example, to target Visual Studio 2017, add --vs 2017 to the command.
33+
* --qt <path>: full path to the folder from where you would like the Qt binaries to be retrieved. By default, CMake would try to auto-detect Qt on the system.
34+
35+
Once the script has finished, in the case of Visual Studio 2019, a sub-folder called 'vs2019' will be created containing the necessary build files.
36+
Go into the 'vs2019' folder (build/win/vs2019) and double click on the RRA.sln file and build the 64-bit Debug and Release builds.
37+
The Release and Debug builds of RRA will be available in the build/release and build/debug folders.
38+
39+
### Building on Ubuntu
40+
Required dependencies can be installed as follows:
41+
42+
sudo apt-get update
43+
sudo apt-get install build-essential python3 chrpath
44+
sudo apt-get install python3-pip
45+
pip install sphinx_rtd_theme
46+
sudo snap install cmake --classic
47+
sudo apt-get install git
48+
sudo apt-get install git-lfs
49+
sudo apt-get install python3-sphinx
50+
sudo apt-get install libxcb-xinerama0
51+
sudo apt-get install mesa-common-dev libglu1-mesa-dev
52+
53+
Qt V5.15.2 can be installed using the Qt online installer available from the Qt 5.15.2 release page here: https://www.qt.io/blog/qt-5.15.2-released
54+
As an alternative, the Qt 5.12.6 offline installer can be used here: https://download.qt.io/archive/qt/5.12/5.12.6/ (the .run file) and installed
55+
to ~/Qt/Qt5.12.6 (the default of ~/Qt5.12.6 will not work).
56+
57+
XCB libraries are required for Qt v5.15.x (they are not needed for older Qt versions). By default, the CMake configuration will attempt to copy
58+
these files from the Qt lib folder. If these files are installed elsewhere on the system or an older version of Qt is being used to build RRA,
59+
the --disable-extra-qt-lib-deploy pre_build.py script argument may be used. This will prevent the build configuration scripts from attempting to copy
60+
the libraries in the post build step. If needed, the XCB library files (libxcb*) can be obtained from the /lib folder of the Radeon Developer Tool
61+
Suite download found at https://gpuopen.com/tools/.
62+
63+
Run the python pre_build.py in the build folder.
64+
65+
$ python3 pre_build.py
66+
67+
Or run the pre_build.py script with the -qt option to specify another version of Qt (also use the --disable-extra-qt-lib-deploy flag since the XCB
68+
libraries aren't needed). For example:
69+
70+
$ python3 pre_build.py --qt 5.12.6 --disable-extra-qt-lib-deploy
71+
72+
The pre_build.py script will construct the output folders and build the necessary makefiles.
73+
To build the release build, use:
74+
75+
$ make -j5 -C linux/make/release
76+
77+
Similarly for the debug build, use:
78+
79+
$ make -j5 -C linux/make/debug
80+
81+
Alternatively, building can be done directly from the prebuild script with the --build option
82+
83+
$ python3 pre_build.py --build

CMakeLists.txt

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
cmake_minimum_required(VERSION 3.11)
2+
3+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/source/renderer/cmake")
4+
5+
## Specify the top level name of the project - this will define the solution name for Visual Studio
6+
project(RRA)
7+
8+
option(RDF_ENABLE_CXX_BINDINGS "Allow usage of C++ interface for RDF library" ON)
9+
option(RDF_STATIC "Build RDF as a static library" OFF)
10+
11+
## For RRA we only care about the Debug and Release configuration types
12+
set(CMAKE_CONFIGURATION_TYPES Debug Release)
13+
14+
## Determine build suffixes based on configuration and bitness
15+
## These values will be inherited by all child projects
16+
set(ADT_PLATFORM_POSTFIX "-x86")
17+
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
18+
set(ADT_PLATFORM_POSTFIX "-x64")
19+
ENDIF()
20+
21+
set (CMAKE_DEBUG_POSTFIX -d)
22+
set (CMAKE_RELEASE_POSTFIX )
23+
24+
IF(WIN32)
25+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../release)
26+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../debug)
27+
ELSE(WIN32)
28+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../../release)
29+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../../debug)
30+
ENDIF(WIN32)
31+
32+
# Add for CentOS compiler warning
33+
add_definitions(-DJSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
34+
35+
include_directories("${PROJECT_SOURCE_DIR}/external/qt_common/")
36+
include_directories("${PROJECT_SOURCE_DIR}/external/")
37+
38+
# Global compiler options
39+
IF(WIN32)
40+
add_compile_options(/MP)
41+
# disable warning C4201: nonstandard extension used: nameless struct/union
42+
add_compile_options(/wd4201)
43+
# this warning is caused by the QT header files - use pragma to disable at source
44+
# disable warning C4127: conditional expression is constant
45+
add_compile_options(/wd4127)
46+
# this warning is caused by QT header files and has been introduced by VS2019 16.9.6
47+
# disable warning C5240: 'nodiscard': attribute is ignored in this syntactic position
48+
add_compile_options(/wd5240)
49+
# bump the stack size
50+
add_link_options(/STACK:16777216)
51+
ELSEIF(UNIX)
52+
# Use -Wno-missing-field-initializers for CentOS compiler warning
53+
add_compile_options(-D_LINUX -Wno-missing-field-initializers -Wno-ignored-qualifiers)
54+
# Allow executable to be double clicked.
55+
add_link_options(-no-pie)
56+
# Use _DEBUG on Unix for Debug Builds (defined automatically on Windows)
57+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
59+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
60+
ENDIF(WIN32)
61+
62+
IF(WIN32)
63+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
64+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
65+
ENDIF(WIN32)
66+
67+
# Macro to build source groups to match directory structure
68+
MACRO(SOURCE_GROUP_BY_FOLDER target)
69+
SET(SOURCE_GROUP_DELIMITER "/")
70+
SET(last_dir "")
71+
SET(files "")
72+
FOREACH(file ${SOURCES})
73+
GET_FILENAME_COMPONENT(dir "${file}" PATH)
74+
IF (NOT "${dir}" STREQUAL "${last_dir}")
75+
IF (files)
76+
SOURCE_GROUP("${last_dir}" FILES ${files})
77+
ENDIF (files)
78+
SET(files "")
79+
ENDIF (NOT "${dir}" STREQUAL "${last_dir}")
80+
SET(files ${files} ${file})
81+
SET(last_dir "${dir}")
82+
ENDFOREACH(file)
83+
IF (files)
84+
SOURCE_GROUP("${last_dir}" FILES ${files})
85+
ENDIF (files)
86+
ENDMACRO(SOURCE_GROUP_BY_FOLDER)
87+
88+
add_subdirectory(external/qt_common/custom_widgets QtCommon/custom_widgets)
89+
add_subdirectory(external/qt_common/utils QtCommon/utils)
90+
add_subdirectory(external/rdf/imported/zstd)
91+
add_subdirectory(external/rdf/rdf)
92+
add_subdirectory(source/backend backend)
93+
add_subdirectory(source/frontend frontend)
94+
add_subdirectory(source/renderer renderer)
95+
96+
# Group external dependency targets into folder
97+
IF(WIN32)
98+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
99+
set_target_properties(QtCustomWidgets
100+
QtUtils
101+
PROPERTIES
102+
FOLDER Dependencies
103+
)
104+
ELSEIF(APPLE)
105+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
106+
set_target_properties(QtCustomWidgets
107+
QtUtils
108+
PROPERTIES
109+
FOLDER Dependencies
110+
)
111+
ENDIF()
112+
113+
IF(WIN32)
114+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT RadeonRaytracingAnalyzer)
115+
ENDIF(WIN32)
116+
117+
## Copy Documentation and Samples to output directory. Note - this target is intentionally not included in
118+
## the default project build. It needs to be explicitly built as a separate project
119+
120+
# Determine where the build process will be placing the binary files
121+
# This is evaluated at project build time - not at CMake generation time
122+
set(BUILD_ROOT $<$<CONFIG:debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$<CONFIG:release>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}>)
123+
124+
# Define the option to pass to the sphinx documentation job
125+
set(SPHINX_OPTION public)
126+
127+
find_program(SPHINX_EXECUTABLE sphinx-build)
128+
if(NOT SPHINX_EXECUTABLE)
129+
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
130+
endif()
131+
132+
# group sphinx source files into a sphinx folder
133+
file(GLOB SPHINX_DOC_FILES ${SPHINX_DOC_FILES} ${CMAKE_SOURCE_DIR}/documentation/source/*.rst)
134+
set (SPHINX_DOC_MAIN ${CMAKE_SOURCE_DIR}/documentation/source/conf.py)
135+
source_group("sphinx" FILES ${SPHINX_DOC_FILES} ${SPHINX_DOC_MAIN})
136+
137+
# group release documents into a release_docs folder
138+
set (RELEASE_DOCS_IN_ROOT
139+
${CMAKE_SOURCE_DIR}/README.md
140+
${CMAKE_SOURCE_DIR}/Release_Notes.txt
141+
${CMAKE_SOURCE_DIR}/NOTICES.txt
142+
${CMAKE_SOURCE_DIR}/License.txt
143+
)
144+
set (RELEASE_DOCS ${RELEASE_DOCS_IN_ROOT})
145+
source_group("release_docs" FILES ${RELEASE_DOCS})
146+
147+
# hang the sphinx build on the conf.py file and specify a dummy output ("sphinx_output")
148+
# this ensures the sphinx docs are built everytime you ask to build the Documentation target
149+
# Sphinx has proper dependency checking, so this works as expected.
150+
# Once built, clean up any unneeded files.
151+
add_custom_target(Documentation SOURCES ${SPHINX_DOC_FILES} ${RELEASE_DOCS} DEPENDS sphinx_output)
152+
add_custom_command(MAIN_DEPENDENCY ${SPHINX_DOC_MAIN} OUTPUT sphinx_output
153+
COMMAND ${CMAKE_COMMAND} -E echo "building Sphinx documentation"
154+
COMMAND ${SPHINX_EXECUTABLE} ${CMAKE_SOURCE_DIR}/documentation/source ${BUILD_ROOT}/docs/help/rra/html/. -t ${SPHINX_OPTION}
155+
COMMAND ${CMAKE_COMMAND} -E remove_directory ${BUILD_ROOT}/docs/help/rra/html/.doctrees
156+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/blas_instance_list.html
157+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/blas_list.html
158+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/blas_properties.html
159+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/blas_viewer.html
160+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/capture.html
161+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/overview.html
162+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/settings.html
163+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/tlas_instance_list.html
164+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/tlas_properties.html
165+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/tlas_viewer.html
166+
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT}/docs/help/rra/html/triangle_list.html
167+
)
168+
169+
add_custom_command(TARGET Documentation POST_BUILD
170+
COMMAND ${CMAKE_COMMAND} -E echo "copying Documentation to output directory"
171+
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT}/docs
172+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RELEASE_DOCS_IN_ROOT} ${BUILD_ROOT}/.
173+
COMMAND ${CMAKE_COMMAND} -E echo "copying Samples to output directory"
174+
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT}/samples
175+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/landscape.rra ${BUILD_ROOT}/samples/sample_trace.rra
176+
)

License.txt

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

0 commit comments

Comments
 (0)