Skip to content

Commit 349cd85

Browse files
committed
Update source code for RRA v1.5 release
1 parent 1906c5f commit 349cd85

File tree

415 files changed

+2692
-1297
lines changed

Some content is hidden

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

415 files changed

+2692
-1297
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ documentation/build
1111
documentation/source/_build
1212
source/frontend/version.h
1313
Buildinfo.properties
14-
external
1514
.vscode
1615
*.aps
16+

CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
#######################################################################################################################
2+
### Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All rights reserved.
3+
### @author AMD Developer Tools Team
4+
#######################################################################################################################
5+
16
cmake_minimum_required(VERSION 3.11)
27

8+
set(SYSTEM_INFO_BUILD_RDF_INTERFACES ON)
9+
10+
311
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
412
include(dev_tools)
513

@@ -8,7 +16,7 @@ project(RRA)
816

917
# Define version information
1018
set(RRA_MAJOR_VERSION 1)
11-
set(RRA_MINOR_VERSION 4)
19+
set(RRA_MINOR_VERSION 5)
1220
if (NOT RRA_BUGFIX_NUMBER)
1321
set(RRA_BUGFIX_NUMBER 0)
1422
endif ()
@@ -52,6 +60,7 @@ ELSE(WIN32)
5260
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../../debug)
5361
ENDIF(WIN32)
5462

63+
5564
# Add for CentOS compiler warning
5665
add_definitions(-DJSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
5766

@@ -102,6 +111,7 @@ ENDMACRO(SOURCE_GROUP_BY_FOLDER)
102111
add_subdirectory(external/qt_common qt_common)
103112
add_subdirectory(external/rdf/imported/zstd)
104113
add_subdirectory(external/rdf/rdf)
114+
add_subdirectory(external/system_info_utils)
105115
add_subdirectory(source/backend backend)
106116
add_subdirectory(source/frontend frontend)
107117
add_subdirectory(source/renderer renderer)
@@ -188,3 +198,4 @@ add_custom_command(TARGET Documentation POST_BUILD
188198
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/landscape.rra ${DOCS_OUTPUT_DIR}/samples/sample_trace.rra
189199
)
190200

201+

build/dependency_map.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
22
##=============================================================================
3-
## Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All rights reserved.
3+
## Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved.
44
## \author AMD Developer Tools Team
55
## \file
66
## \brief List of all external dependencies.
@@ -20,13 +20,15 @@
2020

2121
# Define a set of dependencies that exist as separate git projects.
2222
# each git dependency has a desired directory where it will be cloned - along with a commit to checkout
23+
# The third parameter in the value field is whether to do a shallow clone. Usually, this will be True but if a commit hash is used as a branch, a full clone is needed.
2324
git_mapping = {
24-
github_tools + "QtCommon" : ["../external/qt_common", "v3.12.0"],
25-
github_tools + "UpdateCheckAPI" : ["../external/update_check_api", "v2.0.1"],
26-
github_root + "g-truc/glm" : ["../external/third_party/glm", "0.9.9.8"],
27-
github_root + "KhronosGroup/Vulkan-Headers" : ["../external/third_party/vulkan", "sdk-1.3.211"],
28-
github_root + "zeux/volk" : ["../external/third_party/volk", "1.2.190"],
29-
github_root + "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator" : ["../external/vma", "d2f0313d20c803f83cc3637ac1facf8e4d6899e4"],
30-
github_root + "GPUOpen-Drivers/libamdrdf" : ["../external/rdf", "v1.1.2"],
25+
github_tools + "QtCommon" : ["../external/qt_common", "v3.12.0", True],
26+
github_tools + "UpdateCheckApi" : ["../external/update_check_api", "v2.1.0", True],
27+
github_tools + "system_info_utils" : ["../external/system_info_utils", "88a338a01949f8d8bad60a30b78b65300fd13a9f", False],
28+
github_root + "g-truc/glm" : ["../external/third_party/glm", "0.9.9.8", True],
29+
github_root + "KhronosGroup/Vulkan-Headers" : ["../external/third_party/vulkan", "sdk-1.3.211", True],
30+
github_root + "zeux/volk" : ["../external/third_party/volk", "1.2.190", True],
31+
github_root + "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator" : ["../external/vma", "d2f0313d20c803f83cc3637ac1facf8e4d6899e4", False],
32+
github_root + "GPUOpen-Drivers/libamdrdf" : ["../external/rdf", "v1.1.2", True],
3133
}
3234

build/fetch_dependencies.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
22
##=============================================================================
3-
## Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
3+
## Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All rights reserved.
44
## \author AMD Developer Tools Team
55
## \file
66
## \brief Script to fetch all external git and/or downloadable dependencies
@@ -22,6 +22,11 @@
2222
import platform
2323
import argparse
2424

25+
# Indices for fields in the git_mapping struct.
26+
kDestinationIndex = 0
27+
kCommitIndex = 1
28+
kShallowCloneIndex = 2
29+
2530
# Check for the python 3.x name and import it as the 2.x name
2631
try:
2732
import urllib.request as urllib
@@ -48,19 +53,23 @@ def log_print(message):
4853
def update_git_dependencies(git_mapping, update):
4954
for git_repo in git_mapping:
5055
# add script directory to path
51-
tmp_path = os.path.join(script_root, git_mapping[git_repo][0])
56+
tmp_path = os.path.join(script_root, git_mapping[git_repo][kDestinationIndex])
5257

5358
# clean up path, collapsing any ../ and converting / to \ for Windows
5459
path = os.path.normpath(tmp_path)
5560

5661
# required commit
57-
reqd_commit = git_mapping[git_repo][1]
62+
reqd_commit = git_mapping[git_repo][kCommitIndex]
63+
shallow_clone = git_mapping[git_repo][kShallowCloneIndex]
5864

5965
do_checkout = False
6066
if not os.path.isdir(path):
6167
# directory doesn't exist - clone from git
6268
log_print("Directory %s does not exist, using 'git clone' to get latest from %s" % (path, git_repo))
63-
p = subprocess.Popen((["git", "clone", git_repo ,path]), stderr=subprocess.STDOUT)
69+
if (shallow_clone):
70+
p = subprocess.Popen((["git", "clone", "--depth", "1", "--branch", reqd_commit, git_repo ,path]), stderr=subprocess.STDOUT)
71+
else:
72+
p = subprocess.Popen((["git", "clone", git_repo ,path]), stderr=subprocess.STDOUT)
6473
p.wait()
6574
if(p.returncode == 0):
6675
do_checkout = True

build/pre_build.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
22
##=============================================================================
3-
## Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
3+
## Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All rights reserved.
44
## \author AMD Developer Tools Team
55
## \file
66
## \brief Script to perform all necessary pre build steps. This includes:
@@ -36,7 +36,6 @@
3636
else:
3737
can_fetch = False
3838

39-
4039
# to allow the script to be run from anywhere - not just the cwd - store the absolute path to the script file
4140
script_root = os.path.dirname(os.path.realpath(__file__))
4241

@@ -170,7 +169,6 @@ def check_qt_path(qt_root, qt_root_arg, qt_arg):
170169
if args.platform == "x86":
171170
cmake_output_dir += args.platform
172171

173-
174172
# Clean all files generated by this script or the build process
175173
if (args.clean):
176174
log_print ("Cleaning build ...\n")
@@ -204,7 +202,6 @@ def check_qt_path(qt_root, qt_root_arg, qt_arg):
204202
qt_expanded_root = os.path.expanduser(args.qt_root)
205203
qt_found,qt_path = check_qt_path(qt_expanded_root, args.qt_root, args.qt)
206204

207-
208205
if qt_found == False:
209206
log_error_and_exit(qt_path)
210207

@@ -261,7 +258,6 @@ def generate_config(config):
261258
elif args.toolchain == "2017":
262259
cmake_args.extend(["-Tv141"])
263260

264-
265261
if sys.platform.startswith('linux'):
266262
if args.qt_system:
267263
cmake_args.extend(["-DQT_SYSTEM:BOOL=TRUE"])
@@ -361,8 +357,6 @@ def generate_config(config):
361357
# For Visual Studio, specify the config to build
362358
cmake_args = ["cmake", "--build", build_dir, "--config", config, "--target", "ALL_BUILD", "--", "/m:" + args.build_jobs]
363359
if args.analyze:
364-
# cmake_args.append("/p:CodeAnalysisTreatWarningsAsErrors=true")
365-
# cmake_args.append("/p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset")
366360
cmake_args.append("/p:CodeAnalysisRuleSet=NativeMinimumRules.ruleset")
367361
cmake_args.append("/p:RunCodeAnalysis=true")
368362

cmake/FindXCB.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ foreach(comp ${XCB_FIND_COMPONENTS})
4848
endif()
4949
endforeach()
5050

51-
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
51+
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)

cmake/dev_tools.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#######################################################################################################################
2-
### Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
2+
### Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
33
### \author AMD Developer Tools Team
44
#######################################################################################################################
55

@@ -76,3 +76,4 @@ function(devtools_target_options name)
7676
endif ()
7777

7878
endfunction()
79+

cmake/devtools_qt_helper.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#######################################################################################################################
2-
### Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
2+
### Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
33
### @author AMD Developer Tools Team
44
#######################################################################################################################
55

66
cmake_minimum_required(VERSION 3.10)
77

8+
89
# Attempt to automatically find Qt on the local machine
910
if (UNIX AND NOT APPLE)
1011
find_package(Qt6 QUIET COMPONENTS Core Widgets Network Gui Svg Test GuiPrivate CorePrivate)
@@ -150,3 +151,4 @@ if (Qt5_DIR OR Qt6_DIR)
150151
endif ()
151152
endfunction()
152153
endif ()
154+

shaders/GeometryColorTreeLevel.vs.spv

16 Bytes
Binary file not shown.

source/backend/CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1+
#######################################################################################################################
2+
### Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All rights reserved.
3+
### @author AMD Developer Tools Team
4+
#######################################################################################################################
5+
16
cmake_minimum_required(VERSION 3.11)
27

38
project(Backend)
49

510
set(CMAKE_INCLUDE_CURRENT_DIR ON)
6-
include_directories(AFTER ../backend)
11+
include_directories(AFTER ../backend ../../external/rdf/rdf/inc)
712

813
# List of all source files. It may be possible to have the build process call cmake to update the makefiles
914
# only when this file has changed (ie source files have been added or removed)
15+
1016
set( SOURCES
1117
# common interface include files
1218
"public/rra_api_info.h"
1319
"public/rra_asic_info.h"
20+
"public/rra_system_info.h"
1421
"public/rra_assert.h"
1522
"public/rra_blas.h"
1623
"public/rra_bvh.h"
@@ -41,10 +48,10 @@ set( SOURCES
4148
"rra_data_set.h"
4249
"rra_print.cpp"
4350
"rra_ray_history.cpp"
51+
"rra_system_info.cpp"
4452
"rra_tlas.cpp"
4553
"rra_tlas_impl.h"
4654
"rra_trace_loader.cpp"
47-
"rra_ray_history.cpp"
4855
"surface_area_heuristic.cpp"
4956
"surface_area_heuristic.h"
5057
"rra_async_ray_history_loader.cpp"
@@ -111,6 +118,7 @@ set( LINUX_SOURCES
111118
"linux/safe_crt.cpp"
112119
)
113120

121+
114122
# specify output library name
115123
IF(WIN32)
116124
add_library(${PROJECT_NAME} ${SOURCES})
@@ -122,6 +130,8 @@ ENDIF(WIN32)
122130
devtools_target_options(${PROJECT_NAME})
123131

124132
target_compile_definitions(${PROJECT_NAME} PRIVATE -DRDF_CXX_BINDINGS)
133+
target_compile_definitions(${PROJECT_NAME} PRIVATE -DSYSTEM_INFO_ENABLE_RDF)
134+
125135
IF (WIN32)
126136
target_compile_definitions(${PROJECT_NAME} PRIVATE -DRDF_PLATFORM_WINDOWS -D_CRT_SECURE_NO_WARNINGS)
127137
ELSEIF(UNIX)
@@ -140,3 +150,4 @@ foreach(source IN LISTS SOURCES)
140150
endforeach()
141151
ENDIF(WIN32)
142152

153+

source/backend/api_info.cpp

+35-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//=============================================================================
2-
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
2+
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
33
/// @author AMD Developer Tools Team
44
/// @file
55
/// @brief Implementation for the API Info class.
@@ -40,7 +40,6 @@ namespace rra
4040
}
4141

4242
std::uint32_t chunk_version = chunk_file.GetChunkVersion(identifier);
43-
RRA_UNUSED(chunk_version);
4443

4544
uint64_t header_size = chunk_file.GetChunkHeaderSize(identifier);
4645
uint64_t payload_size = chunk_file.GetChunkDataSize(identifier);
@@ -52,13 +51,37 @@ namespace rra
5251
chunk_file.ReadChunkHeaderToBuffer(identifier, header.data());
5352
}
5453

55-
if (payload_size > 0)
54+
if (payload_size > 0 && payload_size <= sizeof(TraceChunkApiInfo))
5655
{
5756
chunk_file.ReadChunkDataToBuffer(identifier, &chunk_data_);
58-
}
5957

60-
chunk_data_valid_ = true;
61-
return kRraOk;
58+
if (chunk_version == 1)
59+
{
60+
std::unordered_map<TraceApiType_v1, TraceApiType> api_map = {{TraceApiType_v1::DIRECTX_9, TraceApiType::DIRECTX_9},
61+
{TraceApiType_v1::DIRECTX_11, TraceApiType::DIRECTX_11},
62+
{TraceApiType_v1::DIRECTX_12, TraceApiType::DIRECTX_12},
63+
{TraceApiType_v1::VULKAN, TraceApiType::VULKAN},
64+
{TraceApiType_v1::OPENGL, TraceApiType::OPENGL},
65+
{TraceApiType_v1::OPENCL, TraceApiType::OPENCL},
66+
{TraceApiType_v1::MANTLE, TraceApiType::MANTLE},
67+
{TraceApiType_v1::GENERIC, TraceApiType::GENERIC}};
68+
69+
// Map old API enum values to new ones.
70+
const auto& it = api_map.find(static_cast<TraceApiType_v1>(chunk_data_.api_type));
71+
if (it != api_map.end())
72+
{
73+
chunk_data_.api_type = (*it).second;
74+
}
75+
}
76+
77+
chunk_data_valid_ = true;
78+
return kRraOk;
79+
}
80+
else
81+
{
82+
return kRraMajorVersionIncompatible;
83+
}
84+
return kRraErrorMalformedData;
6285
}
6386

6487
const char* ApiInfo::GetApiName() const
@@ -70,6 +93,8 @@ namespace rra
7093

7194
switch (chunk_data_.api_type)
7295
{
96+
case TraceApiType::GENERIC:
97+
return "Generic";
7398
case TraceApiType::DIRECTX_9:
7499
return "DirectX 9";
75100
case TraceApiType::DIRECTX_11:
@@ -84,8 +109,10 @@ namespace rra
84109
return "OpenCL";
85110
case TraceApiType::MANTLE:
86111
return "Mantle";
87-
case TraceApiType::GENERIC:
88-
return "Generic";
112+
case TraceApiType::HIP:
113+
return "HIP";
114+
case TraceApiType::METAL:
115+
return "METAL";
89116

90117
default:
91118
return "";

source/backend/api_info.h

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//=============================================================================
2-
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
2+
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
33
/// @author AMD Developer Tools Team
44
/// @file
55
/// @brief Definition for the API Info class.
@@ -42,7 +42,7 @@ namespace rra
4242
bool IsVulkan() const;
4343

4444
/// @brief enum of API types.
45-
enum class TraceApiType : uint32_t
45+
enum class TraceApiType_v1 : uint32_t
4646
{
4747
DIRECTX_9 = 0,
4848
DIRECTX_11 = 1,
@@ -54,6 +54,20 @@ namespace rra
5454
GENERIC = 7
5555
};
5656

57+
enum class TraceApiType : uint32_t
58+
{
59+
GENERIC = 0,
60+
DIRECTX_9 = 1,
61+
DIRECTX_11 = 2,
62+
DIRECTX_12 = 3,
63+
VULKAN = 4,
64+
OPENGL = 5,
65+
OPENCL = 6,
66+
MANTLE = 7,
67+
HIP = 8,
68+
METAL = 9
69+
};
70+
5771
/// @brief The API Info chunk data format.
5872
struct TraceChunkApiInfo
5973
{

0 commit comments

Comments
 (0)