Skip to content

Commit be99c36

Browse files
committed
AMD FidelityFX SDK 1.1.1
1 parent 1bbe66e commit be99c36

File tree

321 files changed

+10791
-2017
lines changed

Some content is hidden

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

321 files changed

+10791
-2017
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,3 +361,15 @@ MigrationBackup/
361361
# Folders created by the media delivery tool
362362
/media/
363363
/media-cache/
364+
365+
sdk/src/components/frameinterpolation/FrameInterpolation_GDK/Gaming.Xbox.Scarlett.x64/
366+
367+
sdk/src/components/fsr1/FSR1_GDK/Gaming.Xbox.Scarlett.x64/
368+
369+
sdk/src/components/fsr2/FSR2_GDK/Gaming.Xbox.Scarlett.x64/
370+
371+
sdk/src/components/fsr3/FSR3_GDK/Gaming.Xbox.Scarlett.x64/
372+
373+
sdk/src/components/fsr3upscaler/FSR3Upscaler_GDK/Gaming.Xbox.Scarlett.x64/
374+
375+
sdk/src/components/opticalflow/OpticalFlow_GDK/Gaming.Xbox.Scarlett.x64/

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ package_release_samples_pc:
221221
- echo "Packaging FidelityFX SDK Samples"
222222
- 'copy %VULKAN_SDK%\Bin\glslc.exe .\bin'
223223
artifacts:
224-
name: "FIDELITYFX-SDK-SAMPLES-%CI_COMMIT_TAG%-%CI_COMMIT_REF_NAME%-%CI_COMMIT_SHORT_SHA%"
224+
name: "FIDELITYFX-SDK-SAMPLES-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
225225
paths:
226226
- ./bin
227227
- ./docs
@@ -235,4 +235,4 @@ package_release_samples_pc:
235235
- ./common.cmake
236236
- ./LICENSE.txt
237237
- ./readme.md
238-
- ./sample.cmake
238+
- ./sample.cmake

BuildCauldronSolution.bat

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
:: This file is part of the FidelityFX SDK.
2+
::
3+
:: Copyright (C) 2024 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.
22+
23+
@echo off
24+
25+
echo ===============================================================
26+
echo.
27+
echo FidelityFX Build System
28+
echo.
29+
echo ===============================================================
30+
echo Checking pre-requisites...
31+
32+
:: Check if cmake is installed
33+
cmake --version > nul 2>&1
34+
if %errorlevel% NEQ 0 (
35+
echo Cannot find path to CMake. Is CMake installed? Exiting...
36+
exit /b -1
37+
) else (
38+
echo CMake Ready.
39+
)
40+
41+
echo.
42+
echo Building Cauldron (dev) solution
43+
echo.
44+
45+
:: Check directories exist and create if not
46+
if not exist build\ (
47+
mkdir build
48+
)
49+
50+
cd build
51+
:: Clear out CMakeCache
52+
if exist CMakeFiles\ (
53+
rmdir /S /Q CMakeFiles
54+
)
55+
if exist CMakeCache.txt (
56+
del /S /Q CMakeCache.txt
57+
)
58+
cmake .. -D BUILD_TYPE=CAULDRON
59+
60+
:: Come back to root level
61+
cd ..
62+
pause

BuildSamplesSolutionDX12.bat

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:: This file is part of the FidelityFX SDK.
22
::
33
:: Copyright (C) 2024 Advanced Micro Devices, Inc.
4-
::
4+
::
55
:: Permission is hereby granted, free of charge, to any person obtaining a copy
66
:: of this software and associated documentation files(the "Software"), to deal
77
:: in the Software without restriction, including without limitation the rights
@@ -33,13 +33,15 @@ set samples_build_options=-DRUNTIME_SHADER_RECOMPILE=0
3333
set sdk_build_options=-DFFX_AUTO_COMPILE_SHADERS=1
3434

3535
set build_as_dll=
36-
set /P build_as_dll=Build the SDK as DLL [y/n]?
36+
set /P build_as_dll=Build the SDK as DLL [y/n]?
3737

3838
if /i "%build_as_dll%" == "Y" (
3939
set sdk_build_options=-DFFX_AUTO_COMPILE_SHADERS=1 -DFFX_BUILD_AS_DLL=1
4040
set samples_build_options=-DFFX_BUILD_AS_DLL=1
4141
)
4242

43+
:select_component
44+
4345
ECHO 1. ALL
4446
ECHO 2. BLUR
4547
ECHO 3. BREADCRUMBS
@@ -58,7 +60,7 @@ ECHO 15. SSSR
5860
ECHO 16. VRS
5961
ECHO.
6062

61-
set /P samples=Enter numbers of which samples to build [space delimitted]:
63+
set /P samples=Enter numbers of which samples to build [space delimitted]:
6264
:loop
6365
for /f "tokens=1*" %%a in ("%samples%") do (
6466
if %%a == 1 (
@@ -91,7 +93,6 @@ for /f "tokens=1*" %%a in ("%samples%") do (
9193
)
9294
if %%a == 8 (
9395
set samples_build_options=-DFFX_FSR=ON %samples_build_options%
94-
:: Only need to build FSR1 which is brought in via lib import, ffx api has FSR2/3 built into dll
9596
set sdk_build_options=-DFFX_FSR1=ON %sdk_build_options%
9697
)
9798
if %%a == 9 (
@@ -130,18 +131,31 @@ for /f "tokens=1*" %%a in ("%samples%") do (
130131
)
131132
if defined samples goto :loop
132133

134+
:: determine architecture
135+
if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" (
136+
set arch=ARM64
137+
set samples_build_options=-AARM64 -DCMAKE_GENERATOR_PLATFORM=ARM64 %samples_build_options%
138+
set sdk_build_options=-AARM64 -DCMAKE_GENERATOR_PLATFORM=ARM64 %sdk_build_options%
139+
) else (
140+
set arch=X64
141+
set samples_build_options=-Ax64 -DCMAKE_GENERATOR_PLATFORM=x64 %samples_build_options%
142+
set sdk_build_options=-Ax64 -DCMAKE_GENERATOR_PLATFORM=x64 %sdk_build_options%
143+
)
144+
echo architecture %arch% detected
145+
echo.
146+
133147
set build_type=-DBUILD_TYPE=SAMPLES_DX12
134-
set sdk_build_options=-DFFX_API_BACKEND=DX12_X64 %sdk_build_options%
148+
set sdk_build_options=-DFFX_API_BACKEND=DX12_%arch% %sdk_build_options%
135149

136150
:: Start by building the backend SDK
137-
echo Building native x64 backends: %sdk_build_options%
151+
echo Building native %arch% backends: %sdk_build_options%
138152
cd sdk
139153
call BuildFidelityFXSDK.bat %sdk_build_options%
140154
cd ..
141155

142156
:: Check directories exist and create if not
143157
if not exist build\ (
144-
mkdir build
158+
mkdir build
145159
)
146160

147161
cd build
@@ -154,10 +168,10 @@ if exist CMakeCache.txt (
154168
)
155169

156170
echo.
157-
echo Building SDK sample solutions %samples_build_options%
171+
echo Building SDK sample solutions %samples_build_options%
158172
echo.
159173

160-
cmake -A x64 .. %build_type% %samples_build_options%
174+
cmake .. %build_type% %samples_build_options%
161175

162176
:: Come back to root level
163177
cd ..

BuildSamplesSolutionVK.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if /i "%build_as_dll%" == "Y" (
4040
set samples_build_options=-DFFX_BUILD_AS_DLL=1
4141
)
4242

43+
:select_component
44+
4345
ECHO 1. ALL
4446
ECHO 2. BLUR
4547
ECHO 3. BREADCRUMBS
@@ -91,7 +93,6 @@ for /f "tokens=1*" %%a in ("%samples%") do (
9193
)
9294
if %%a == 8 (
9395
set samples_build_options=-DFFX_FSR=ON %samples_build_options%
94-
:: Only need to build FSR1 which is brought in via lib import, ffx api has FSR2/3 built into dll
9596
set sdk_build_options=-DFFX_FSR1=ON %sdk_build_options%
9697
)
9798
if %%a == 9 (

CMakeLists.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# This file is part of the FidelityFX SDK.
2-
#
2+
#
33
# Copyright (C) 2024 Advanced Micro Devices, Inc.
4-
#
4+
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files(the "Software"), to deal
77
# in the Software without restriction, including without limitation the rights
88
# to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
99
# copies of the Software, and to permit persons to whom the Software is
1010
# furnished to do so, subject to the following conditions :
11-
#
11+
#
1212
# The above copyright notice and this permission notice shall be included in
1313
# all copies or substantial portions of the Software.
14-
#
14+
#
1515
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -50,9 +50,9 @@ include(common)
5050
include(sample)
5151

5252
# Configuration setup
53-
set(CMAKE_GENERATOR_PLATFORM x64)
54-
55-
if (CMAKE_GENERATOR_PLATFORM STREQUAL x64)
53+
if (CMAKE_GENERATOR_PLATFORM STREQUAL x64 OR
54+
CMAKE_GENERATOR_PLATFORM STREQUAL ARM64 OR
55+
CMAKE_GENERATOR_PLATFORM STREQUAL ARM64EC)
5656
message(STATUS "Creating sample configs ...")
5757
set(CMAKE_CONFIGURATION_TYPES "")
5858
if (CAULDRON_DX12)
@@ -61,14 +61,14 @@ if (CMAKE_GENERATOR_PLATFORM STREQUAL x64)
6161
createConfig(DX12 ReleaseDX12 RELEASE)
6262
list(APPEND CMAKE_CONFIGURATION_TYPES "DebugDX12;RelWithDebInfoDX12;ReleaseDX12;")
6363
endif()
64-
64+
6565
if (CAULDRON_VK)
6666
createConfig(VK DebugVK DEBUG)
6767
createConfig(VK RelWithDebInfoVK RELWITHDEBINFO)
6868
createConfig(VK ReleaseVK RELEASE)
6969
list(APPEND CMAKE_CONFIGURATION_TYPES "DebugVK;RelWithDebInfoVK;ReleaseVK;")
7070
endif()
71-
71+
7272
message(STATUS "Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
7373

7474
# Set compile definitions as well
@@ -83,7 +83,7 @@ if (CMAKE_GENERATOR_PLATFORM STREQUAL x64)
8383
)
8484

8585
else()
86-
message(FATAL_ERROR "Requested architecture not yet supported!)")
86+
message(FATAL_ERROR "Requested architecture ${CMAKE_GENERATOR_PLATFORM} not yet supported!)")
8787
endif()
8888

8989
# Ouput exe to bin directory
@@ -102,12 +102,12 @@ endif()
102102
add_library(ffx_backend_native STATIC IMPORTED)
103103
set_target_properties(ffx_backend_native PROPERTIES
104104
IMPORTED_CONFIGURATIONS "DebugDX12;DebugVK;RelWithDebInfoDX12;RelWithDebInfoVK;ReleaseDX12;ReleaseVK"
105-
IMPORTED_LOCATION_DEBUGDX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_x64d.lib"
106-
IMPORTED_LOCATION_RELEASEDX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_x64.lib"
107-
IMPORTED_LOCATION_RELWITHDEBINFODX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_x64drel.lib"
108-
IMPORTED_LOCATION_DEBUGVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_x64d.lib"
109-
IMPORTED_LOCATION_RELEASEVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_x64.lib"
110-
IMPORTED_LOCATION_RELWITHDEBINFOVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_x64drel.lib")
105+
IMPORTED_LOCATION_DEBUGDX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_${CMAKE_GENERATOR_PLATFORM}d.lib"
106+
IMPORTED_LOCATION_RELEASEDX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_${CMAKE_GENERATOR_PLATFORM}.lib"
107+
IMPORTED_LOCATION_RELWITHDEBINFODX12 "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_dx12_${CMAKE_GENERATOR_PLATFORM}drel.lib"
108+
IMPORTED_LOCATION_DEBUGVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_${CMAKE_GENERATOR_PLATFORM}d.lib"
109+
IMPORTED_LOCATION_RELEASEVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_${CMAKE_GENERATOR_PLATFORM}.lib"
110+
IMPORTED_LOCATION_RELWITHDEBINFOVK "${SDK_ROOT}/bin/ffx_sdk/ffx_backend_vk_${CMAKE_GENERATOR_PLATFORM}drel.lib")
111111

112112
if (FFX_BUILD_AS_DLL)
113113
file(GLOB SDK_DLLS "${SDK_ROOT}/bin/ffx_sdk/*.dll")

ClearMediaCache.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
@echo off
2424

25-
SET ffx_sdk_root=%~dp0
25+
SET ffx_sdk_root="%~dp0"
2626

2727
echo Clearing media delivery cache for SDK root: %ffx_sdk_root%
2828

131 KB
Binary file not shown.
61 KB
Binary file not shown.

UpdateMedia.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
:: Known bundle SHA256 hash to attempt to download
2626
SET default_bundle_sha256=7c82a9704f11c082ad12115eadb944e7884a73cb678bb51e8c7486a3190c7f98
2727

28-
SET ffx_sdk_root=%~dp0
28+
SET ffx_sdk_root="%~dp0"
2929

3030
SET ARG=%1
3131
IF DEFINED ARG (

common.cmake

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# This file is part of the FidelityFX SDK.
2-
#
2+
#
33
# Copyright (C) 2024 Advanced Micro Devices, Inc.
4-
#
4+
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files(the "Software"), to deal
77
# in the Software without restriction, including without limitation the rights
88
# to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
99
# copies of the Software, and to permit persons to whom the Software is
1010
# furnished to do so, subject to the following conditions :
11-
#
11+
#
1212
# The above copyright notice and this permission notice shall be included in
1313
# all copies or substantial portions of the Software.
14-
#
14+
#
1515
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -63,6 +63,25 @@ set(FFX_COMPONENTS_PATH ${SDK_ROOT}/src/components)
6363
set(FFX_HOST_BACKENDS_PATH ${FFX_HOST_PATH}/backends)
6464
set(FFX_SRC_BACKENDS_PATH ${SDK_ROOT}/src/backends)
6565

66+
#Setup pathing to FFX_API objects
67+
if (FFX_DEV_API)
68+
set(FFX_API_ROOTPATH ${API_ROOT}/bin)
69+
set(FFX_API_PATHNAME_DX12D ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12d)
70+
set(FFX_API_PATHNAME_DX12DREL ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12drel)
71+
set(FFX_API_PATHNAME_DX12 ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12)
72+
set(FFX_API_PATHNAME_VKD ${FFX_API_ROOTPATH}/amd_fidelityfx_vkd)
73+
set(FFX_API_PATHNAME_VKDREL ${FFX_API_ROOTPATH}/amd_fidelityfx_vkdrel)
74+
set(FFX_API_PATHNAME_VK ${FFX_API_ROOTPATH}/amd_fidelityfx_vk)
75+
else()
76+
set(FFX_API_ROOTPATH ${PREBUILT_SIGNED_DLL_ROOT})
77+
set(FFX_API_PATHNAME_DX12D ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12)
78+
set(FFX_API_PATHNAME_DX12DREL ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12)
79+
set(FFX_API_PATHNAME_DX12 ${FFX_API_ROOTPATH}/amd_fidelityfx_dx12)
80+
set(FFX_API_PATHNAME_VKD ${FFX_API_ROOTPATH}/amd_fidelityfx_vk)
81+
set(FFX_API_PATHNAME_VKDREL ${FFX_API_ROOTPATH}/amd_fidelityfx_vk)
82+
set(FFX_API_PATHNAME_VK ${FFX_API_ROOTPATH}/amd_fidelityfx_vk)
83+
endif()
84+
6685
# Set top level includes (all projects will need these to some extent)
6786
include_directories(${CAULDRON_ROOT}/framework/inc)
6887
include_directories(${CAULDRON_ROOT}/framework/libs)
@@ -73,7 +92,9 @@ include_directories(${SAMPLE_ROOT})
7392
include_directories(${SDK_ROOT}/include)
7493

7594

76-
if (CMAKE_GENERATOR_PLATFORM STREQUAL x64)
95+
if (CMAKE_GENERATOR_PLATFORM STREQUAL x64 OR
96+
CMAKE_GENERATOR_PLATFORM STREQUAL ARM64 OR
97+
CMAKE_GENERATOR_PLATFORM STREQUAL ARM64EC)
7798
#Set so taken by default when creating custom configs
7899
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
79100
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")

docs/getting-started/ffx-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!-- @page page_ffx-api Introduction to FidelityFX API -->
22

3-
<h1>Introduction to the FidelityFX API</h1>
3+
<h1>Introduction to FidelityFX API</h1>
44

5-
The FidelityFX API is a simple API for FidelityFX techniques, created with a small ABI surface and forwards-compatibility. It is delivered in Dynamic Link Library form and consists of 5 functions, declared in [`ffx_api.h`](/ffx-api/include/ffx_api/ffx_api.h):
5+
The FidelityFX API is a simple API created for small ABI surface and forwards-compatibility. It is delivered in Dynamic Link Library form and consists of 5 functions, declared in [`ffx_api.h`](../../ffx-api/include/ffx_api/ffx_api.h):
66

77
* `ffxCreateContext`
88
* `ffxDestroyContext`
@@ -14,7 +14,8 @@ Arguments are provided in a linked list of structs, each having a header with a
1414

1515
An application using the FidelityFX API must use one of the provided signed DLLs. This can be loaded at runtime with `LoadLibrary` and `GetProcAddress` (this is recommended) or at application startup using the dynamic linker via the .lib file.
1616

17-
Backend-specific functionality (for DirectX 12 or Vulkan) is only supported with the respective DLL. Linking to both within the same application is not possible due to name resolution conflicts.
17+
Backend-specific functionality (for DirectX 12 or Vulkan) is only supported with the respective DLL.
18+
Linking to both within the same application is not possible due to name resolution conflicts.
1819

1920
For convenience in C++ applications, helpers for initializing struct types correctly and linking headers are provided. Simply use the `.hpp` version of each header and replace the `ffx` prefix with the `ffx::` namespace.
2021
Note that the helper functions wrapping API functions only work when linking using the .lib file. Using them with runtime loading will result in linker errors.
@@ -32,7 +33,6 @@ typedef struct ffxApiHeader
3233
```
3334

3435
Each descriptor has an associated struct type, usually defined directly before the struct declaration in the header.
35-
3636
The `type` field in the header must be set to that struct type. Failing to do this is undefined behavior and will likely result in crashes. The C++ headers (with extension `.hpp`) expose helpers for automatic initialization.
3737

3838
The `pNext` field is used to specify additional parameters and extensions in a linked list (or "chain"). Some calls require chaining certain other structs.

docs/getting-started/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ If you find an issue, or have a request for the SDK, please consider opening an
5454
<!-- - @subpage page_running-samples_index "Running the samples for the SDK" -->
5555
<!-- - @subpage page_getting-started_naming-guidelines "FidelityFX naming guidelines for game applications" -->
5656
<!-- - @subpage page_ffx-api "Introduction to FidelityFX API" -->
57+
<!-- - @subpage page_migration "Migrating from FSR 3.0 to FSR 3.1" -->

0 commit comments

Comments
 (0)