Skip to content

Commit e1d747a

Browse files
authored
Merge pull request #67 from GPUOpen-Tools/development
Beta2 - origin/development
2 parents 49496e2 + 849c8c5 commit e1d747a

996 files changed

Lines changed: 57091 additions & 6304 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ThirdParty/UnorderedDense/
3434
ThirdParty/BTree/
3535
ThirdParty/ZLIB/
3636
ThirdParty/AgilitySDK/
37+
ThirdParty/Eigen/
38+
ThirdParty/STB/
3739

3840
## Ignore Visual Studio temporary files, build results, and
3941
## files generated by popular Visual Studio add-ons.

.gitlab-ci.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ stages:
88

99
build_release:
1010
tags:
11-
- windows
12-
- amd64
11+
- gpu-reshape
1312
stage: build
1413
script:
15-
- 'cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Release" -DINSTALL_THIRD_PARTY:BOOL="1" -B "cmake-build-vs2019" -DCMAKE_VS_NUGET_PACKAGE_RESTORE=ON'
16-
- 'cmake -P Build/Utils/CSProjPatch.cmake cmake-build-vs2019'
14+
- 'cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="RelWithDebInfo" -DINSTALL_THIRD_PARTY:BOOL="1" -B "cmake-build-vs2022" -DCMAKE_VS_NUGET_PACKAGE_RESTORE=ON'
15+
- 'cmake -P Build/Utils/CSProjPatch.cmake cmake-build-vs2022'
16+
- 'dotnet restore "cmake-build-vs2022/GPU-Reshape.sln"'
1717
# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18026
18-
# 'cmake --build cmake-build-vs2019 --config Release --parallel 4 -- /p:CL_MPcount=16'
19-
- '"cmake-build-vs2019/GRS_MSBuild.bat" "cmake-build-vs2019/GPU-Reshape.sln" /p:Configuration=Release'
18+
# 'cmake --build cmake-build-vs2022 --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16'
19+
- '"cmake-build-vs2022/GRS_MSBuild.bat" "cmake-build-vs2022/GPU-Reshape.sln" /p:Configuration=RelWithDebInfo'
2020
artifacts:
2121
name: "GPU-Reshape-Release-$CI_COMMIT_SHORT_SHA"
2222
paths:
23-
- Bin/MSVC/Release/
23+
- Bin/MSVC/RelWithDebInfo/
2424

2525
build_debug:
2626
tags:
@@ -29,11 +29,12 @@ build_debug:
2929
stage: build
3030
when: manual
3131
script:
32-
- 'cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DINSTALL_THIRD_PARTY:BOOL="1" -B "cmake-build-vs2019" -DCMAKE_VS_NUGET_PACKAGE_RESTORE=ON'
33-
- 'cmake -P Build/Utils/CSProjPatch.cmake cmake-build-vs2019'
32+
- 'cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DINSTALL_THIRD_PARTY:BOOL="1" -B "cmake-build-vs2022" -DCMAKE_VS_NUGET_PACKAGE_RESTORE=ON'
33+
- 'cmake -P Build/Utils/CSProjPatch.cmake cmake-build-vs2022'
34+
- 'dotnet restore "cmake-build-vs2022/GPU-Reshape.sln"'
3435
# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18026
35-
# 'cmake --build cmake-build-vs2019 --config Debug --parallel 4 -- /p:CL_MPcount=16'
36-
- '"cmake-build-vs2019/GRS_MSBuild.bat" "cmake-build-vs2019/GPU-Reshape.sln" /p:Configuration=Debug'
36+
# 'cmake --build cmake-build-vs2022 --config Debug --parallel 4 -- /p:CL_MPcount=16'
37+
- '"cmake-build-vs2022/GRS_MSBuild.bat" "cmake-build-vs2022/GPU-Reshape.sln" /p:Configuration=Debug'
3738
artifacts:
3839
name: "GPU-Reshape-Debug-$CI_COMMIT_SHORT_SHA"
3940
paths:
@@ -47,11 +48,11 @@ package_release:
4748
dependencies:
4849
- build_release
4950
script:
50-
- '"Build\Scripts\Package.bat" MSVC/Release'
51+
- '"Build\Scripts\Package.bat" MSVC/RelWithDebInfo'
5152
artifacts:
5253
name: "GPU-Reshape-Release-$CI_COMMIT_SHORT_SHA"
5354
paths:
54-
- Package/MSVC/Release/
55+
- Package/MSVC/RelWithDebInfo/
5556

5657
package_debug:
5758
tags:

Build/CSharp.cmake

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,47 +34,63 @@ function(Project_AddDotNet NAME)
3434
# DotNet
3535
set_target_properties(
3636
${NAME} PROPERTIES
37-
VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.8"
37+
DOTNET_SDK "Microsoft.NET.Sdk"
38+
DOTNET_TARGET_FRAMEWORK "net8.0"
39+
VS_GLOBAL_Platforms "x64"
40+
VS_GLOBAL_RuntimeIdentifier "win-x64"
41+
VS_GLOBAL_AppendTargetFrameworkToOutputPath "false"
42+
VS_GLOBAL_AppendRuntimeIdentifierToOutputPath "false"
3843
VS_GLOBAL_ROOTNAMESPACE ${NAME}
3944
)
4045

4146
# IDE source discovery
4247
SetSourceDiscovery(${NAME} CS Include Source Schema)
4348
endfunction()
4449

50+
# Add a .NET merge target for generated files
51+
# ! Must be called in the same CMakeLists.txt as the custom commands
52+
function(Project_AddDotNetGeneratedMerge NAME GENERATED_SOURCES)
53+
set(Command "")
54+
55+
# Copy each schema target
56+
foreach(File ${${GENERATED_SOURCES}})
57+
list(APPEND Command COMMAND "${CMAKE_COMMAND}" -E copy "${File}.gen" "${File}")
58+
59+
# Generated project / MSBUILD does not check that if inbound file originates from
60+
# another target.
61+
if (NOT EXISTS ${File})
62+
file(WRITE "${File}" "Generation target file")
63+
endif()
64+
endforeach()
65+
66+
# Schema Gen -> Schema
67+
add_custom_target(
68+
${NAME}
69+
DEPENDS ${${GENERATED_SOURCES}_Gen}
70+
BYPRODUCTS ${${GENERATED_SOURCES}}
71+
${Command}
72+
)
73+
endfunction()
74+
4575
function(Project_AddDotNetEx)
4676
cmake_parse_arguments(
4777
ARGS
4878
"UNSAFE;EXECUTABLE" # Options
4979
"NAME;LANG;PROPS" # One Value
50-
"SOURCE;GENERATED;ASSEMBLIES;LIBS;FLAGS" # Multi Value
80+
"SOURCE;DEPENDENCIES;ASSEMBLIES;LIBS;FLAGS" # Multi Value
5181
${ARGN}
5282
)
5383

54-
if (NOT "${ARGS_GENERATED}" STREQUAL "")
55-
# Generate sham target
56-
# ! WORKAROUND, Visual Studio generators do not support C# sources from add_custom_command
57-
# Check introduced by 3.24
58-
add_library(${ARGS_NAME}.Sham INTERFACE ${${ARGS_GENERATED}_Sham})
59-
60-
# Create dummy file to keep MSVC happy
61-
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${${ARGS_GENERATED}_Sham}")
62-
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${${ARGS_GENERATED}_Sham}" Sham)
63-
endif()
64-
endif()
65-
6684
# Create library
6785
if ("${ARGS_EXECUTABLE}")
6886
add_executable(
6987
${ARGS_NAME}
7088
${ARGS_SOURCE}
71-
${${ARGS_GENERATED}}
7289
)
7390
else()
7491
add_library(
7592
${ARGS_NAME} SHARED
7693
${ARGS_SOURCE}
77-
${${ARGS_GENERATED}}
7894
)
7995
endif()
8096

@@ -95,7 +111,12 @@ function(Project_AddDotNetEx)
95111
# Set .NET, link to assemblies and libs
96112
set_target_properties(
97113
${ARGS_NAME} PROPERTIES
98-
VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.8"
114+
DOTNET_SDK "Microsoft.NET.Sdk"
115+
DOTNET_TARGET_FRAMEWORK "net8.0"
116+
VS_GLOBAL_Platforms "x64"
117+
VS_GLOBAL_RuntimeIdentifier "win-x64"
118+
VS_GLOBAL_AppendTargetFrameworkToOutputPath "false"
119+
VS_GLOBAL_AppendRuntimeIdentifierToOutputPath "false"
99120
VS_GLOBAL_ROOTNAMESPACE "${ARGS_NAME}"
100121
VS_DOTNET_REFERENCES "${ARGS_ASSEMBLIES};${ARGS_LIBS}"
101122
VS_USER_PROPS "${CMAKE_SOURCE_DIR}/Build/cs.configuration.props"
@@ -128,10 +149,10 @@ function(Project_AddDotNetEx)
128149
endif()
129150
endif()
130151

131-
# Reference sham target to let dependencies generate before use
132-
if (NOT "${ARGS_GENERATED}" STREQUAL "")
133-
add_dependencies(${ARGS_NAME} ${ARGS_NAME}.Sham)
134-
endif()
152+
# Add additional dependencies
153+
if (NOT "${ARGS_DEPENDENCIES}" STREQUAL "")
154+
add_dependencies(${ARGS_NAME} ${ARGS_DEPENDENCIES})
155+
endif()
135156

136157
# IDE source discovery
137158
SetSourceDiscovery(${ARGS_NAME} ${ARGS_LANG} Include Source)

Build/Tools/package.py

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import os
2828
import sys
2929
import shutil
30+
import subprocess
3031

3132
# Paths
3233
root_dir = os.path.join("../", "../")
@@ -39,35 +40,48 @@
3940
# Mostly unit testing, build time tooling
4041
".exe",
4142

43+
# All configuration json, handled through required files
44+
".json",
45+
4246
# Build time tooling dependencies
4347
"libclang.dll",
4448

4549
# Test dependencies
46-
"VK_GPUOpen_Test_UserDataLayer.json",
50+
"GRS.Libraries.Message.Benchmark.DotNet.dll",
51+
"GRS.Backends.Vulkan.Tests.UserDataLayer.dll",
4752
"vulkan-1.dll"
4853
]
4954

55+
publish_projects = [
56+
# "Source/UIX/Studio/Studio.csproj",
57+
# "Source/Services/Discovery/DotNet/NotifyIcon/NotifyIcon.csproj"
58+
]
59+
5060
# All required files
5161
require_list = [
5262
# <The> GPU Reshape
5363
"GPUReshape.exe",
5464

55-
# Dependencies
56-
"GPUReshape.NotifyIcon.exe",
57-
"GRS.Backends.DX12.Service.exe",
58-
"GRS.Backends.DX12.Service.RelFunTBL.exe",
59-
"GRS.Services.HostResolver.Standalone.exe",
60-
"GRS.Services.Discovery.Cleanup.exe",
61-
"XamlColorSchemeGenerator.exe",
65+
# Executable dependencies
66+
"GPUReshape.NotifyIcon.exe", # Task bar notification icon
67+
"GRS.Backends.DX12.Service.exe", # Handles project detouring for D3D12 objects
68+
"GRS.Backends.DX12.Service.RelFunTBL.exe", # Relative function table generator for x86
69+
"GRS.Services.HostResolver.Standalone.exe", # Host resolver tool for discovery
70+
"GRS.Services.Discovery.Cleanup.exe", # General cleanup tool for discovery
71+
"XamlColorSchemeGenerator.exe", # UIX dependency
72+
73+
# UIX runtime dependency json
74+
"GPUReshape.deps.json",
75+
"GPUReshape.runtimeconfig.json",
76+
"GPUReshape.NotifyIcon.deps.json",
77+
"GPUReshape.NotifyIcon.runtimeconfig.json",
78+
"VK_LAYER_GPUOPEN_GRS.json"
6279
]
6380

6481
# All required folders
6582
require_folders = [
6683
"Plugins",
67-
"runtimes/win",
68-
"runtimes/win-x64",
69-
"runtimes/win-arm64",
70-
"runtimes/win7-x64"
84+
"Dependencies"
7185
]
7286

7387
# All extra folders
@@ -155,3 +169,15 @@
155169
# Copy all contents
156170
sys.stdout.write(f"\tPackaging {folder[0]}\n")
157171
shutil.copytree(src_folder_dir, pck_folder_dir)
172+
173+
# Package all relevant projects
174+
for project in publish_projects:
175+
subprocess.run([
176+
"dotnet",
177+
"publish",
178+
os.path.join(root_dir, project),
179+
"-c", package.split('/')[-1],
180+
"-o", pck_dir,
181+
"--self-contained",
182+
"-r", "win-x64"
183+
])

Build/cs.configuration.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ResolveNuGetPackages>false</ResolveNuGetPackages>
5+
</PropertyGroup>
36
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
47
<Optimize>true</Optimize>
58
</PropertyGroup>

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ if (${ENABLE_UIX} AND CMAKE_GENERATOR MATCHES "Visual Studio")
149149
enable_language(CSharp)
150150

151151
# Set standard C# properties
152-
SET(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "v4.8")
153-
SET(CMAKE_CSharp_FLAGS "/langversion:6")
152+
SET(CMAKE_DOTNET_TARGET_FRAMEWORK "net8.0")
153+
SET(CMAKE_CSharp_FLAGS "/langversion:latest")
154154
SET(CMAKE_CSharp_FLAGS "/platform:x64")
155155
else()
156156
set(BUILD_UIX OFF)
@@ -204,11 +204,15 @@ endforeach()
204204

205205
# Configure file for multi-configurators
206206
function(ConfigureOutput FILE OUT)
207+
get_filename_component(Directory "${OUT}" DIRECTORY)
208+
207209
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
208210
foreach(Config ${CMAKE_CONFIGURATION_TYPES})
211+
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${Config}/${Directory})
209212
configure_file(${FILE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${Config}/${OUT} COPYONLY)
210213
endforeach()
211214
else()
215+
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${Directory})
212216
configure_file(${FILE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OUT} COPYONLY)
213217
endif()
214218
endfunction()
@@ -224,6 +228,8 @@ endfunction()
224228
# Add build support
225229
if (NOT THIN_X86_BUILD)
226230
add_subdirectory(Build)
231+
else()
232+
include(Build/Files.cmake)
227233
endif()
228234

229235
# Add external projects

Documentation/Build.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# Build Instructions
22

3-
Build instructions for Windows. _Linux support pending._
3+
Build instructions for Windows. _Linux support upcoming!_
44

55
## Supported environments
66

7-
A minimum version of **CMake 3.17** is required to configure and build the project. Additionally, pulled dependencies expect the following tools to be installed on the system:
7+
A minimum version of **CMake 3.24** is required to configure and build the project. Additionally, pulled dependencies expect the following tools to be installed on the system:
88

99
- **Python 3.x**
1010

11-
Building experimental UIX requires the following dependencies to be installed on the system:
11+
Building UIX requires the following dependencies to be installed on the system:
1212

13-
- **.NET Framework 4.8 (.NET 5.0)**
14-
- **.NET Core SDK**
13+
- **.NET 8.0 SDK**
1514

1615
### Windows
1716

@@ -21,23 +20,28 @@ Standard Visual Studio solutions may be generated by invoking the VisualStudio[V
2120
the below set-ups are supported:
2221

2322
- Toolchains
24-
- Visual Studio 2017 / 2019 / 2022
23+
- Visual Studio 2022 17.8 (or just the build tools)
2524
- Generators
2625
- Visual Studio
2726
- Ninja
2827
- Compilers
2928
- MSVC
3029
- Clang-cl (11+)
3130

31+
CMake / solution-generation is friendly for Visual Studio, Rider, and CLion!
32+
3233
## Configuration options
3334

34-
| Option | Platform | Default | Description |
35-
|-----------------------|----------|---------|------------------------------------------------------------------|
36-
| INSTALL_THIRD_PARTY | All | `ON` | Fetch and install third party libraries |
37-
| ENABLE_UIX | All | `ON` | Enables UIX building |
38-
| ENABLE_BACKEND_VULKAN | All | `ON` | Enables Vulkan support |
39-
| ENABLE_BACKEND_DX12 | All | `ON` | Enables DX12 support |
40-
| ENABLE_MIXED_COMPILER | All | `ON` | Enables support for multiple compilers, separates built binaries |
35+
| Option | Platform | Default | Description |
36+
|-------------------------|----------|---------|------------------------------------------------------------------|
37+
| INSTALL_THIRD_PARTY | All | `ON` | Fetch and install third party libraries |
38+
| ENABLE_UIX | All | `ON` | Enables UIX building |
39+
| ENABLE_BACKEND_VULKAN | All | `ON` | Enables Vulkan support |
40+
| ENABLE_BACKEND_DX12 | All | `ON` | Enables DX12 support |
41+
| ENABLE_MIXED_COMPILER | All | `ON` | Enables support for multiple compilers, separates built binaries |
42+
| ENABLE_NUGET_RESTORE | All | `ON` | Enables nuget package restores on configuration |
43+
| ENABLE_X86_BOOTSTRAPPER | All | `ON` | Enables the 32-bit bootstrapper for detoured applications |
44+
| ENABLE_EXPERIMENTAL | All | `ON` | Enable experimental features |
4145

4246
Please see *Developmental configuration options* below for additional options.
4347

Documentation/Redist/ReadMe.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11

22
# Redist
33

4-
This toolset requires the .NET SDK 5.0 runtimes which may be found below: </br>
5-
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-5.0.408-windows-x64-installer
4+
### .NET Desktop Runtime 8.0.7 </br>
5+
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.7-windows-x64-installer
6+
7+
### Visual C++ Runtimes 17 </br>
8+
https://aka.ms/vs/17/release/vc_redist.x64.exe
9+
https://aka.ms/vs/17/release/vc_redist.x86.exe
10+
11+
Both x64 and x86 are required. This is due to process bootstrapping operating across both 64 and 32 bit processes.

0 commit comments

Comments
 (0)