Skip to content

Commit 3808565

Browse files
Build Opti-oriented build using actions (#2)
* Build test * Update install-vulkan-sdk * fix build action (#1) * init submodules, pin vulkan version * add branch to test * chore: revert temp branch action * fix: rm unneeded fetch depth * Build just the main dll * Binary distributions changes * Reduce nesting * Distinguish the build from Nukem's --------- Co-authored-by: Kurt Himebauch <[email protected]>
1 parent 0e253f6 commit 3808565

File tree

7 files changed

+152
-20
lines changed

7 files changed

+152
-20
lines changed

.github/workflows/workflow.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: 'Build and publish artifacts'
2+
3+
on:
4+
push:
5+
branches: ['master', 'gh-actions']
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
VCPKG_FEATURE_FLAGS: dependencygraph
14+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
15+
16+
jobs:
17+
build-and-package:
18+
runs-on: windows-2022
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Set up GitHub Actions cache environment
26+
uses: actions/github-script@v7
27+
with:
28+
script: |
29+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
30+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
31+
32+
# https://github.com/actions/runner-images/issues/6376
33+
- name: Set up Vcpkg environment
34+
shell: bash
35+
run: |
36+
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
37+
38+
# Custom step is required because vcvarsall doesn't persist otherwise. VS2022 is the only option on windows-2022 runners.
39+
- name: Set up VS2022 toolset
40+
uses: ilammy/msvc-dev-cmd@v1
41+
with:
42+
arch: x64
43+
44+
- name: Install and set up Vulkan SDK
45+
uses: humbletim/[email protected]
46+
with:
47+
version: 1.4.309.0
48+
cache: true
49+
50+
# Needed to build FSR
51+
- name: Download and extract WinPixEventRuntime.dll
52+
shell: pwsh
53+
run: |
54+
$url = "https://www.nuget.org/api/v2/package/WinPixEventRuntime/1.0.240308001"
55+
$nupkgPath = "$env:RUNNER_TEMP\WinPixEventRuntime.nupkg"
56+
$extractPath = "$env:RUNNER_TEMP\WinPixExtracted"
57+
$destinationDir = "${{ github.workspace }}\dependencies\FidelityFX-SDK\sdk\libs\pix\bin\x64"
58+
$dllRelativePath = "bin\x64\WinPixEventRuntime.dll"
59+
$dllExtractedPath = Join-Path $extractPath $dllRelativePath
60+
61+
Invoke-WebRequest -Uri $url -OutFile $nupkgPath
62+
Expand-Archive -Path $nupkgPath -DestinationPath $extractPath -Force
63+
64+
New-Item -ItemType Directory -Force -Path $destinationDir
65+
Copy-Item -Path $dllExtractedPath -Destination $destinationDir -Force
66+
67+
- name: Build and set up FidelityFX SDK
68+
shell: cmd
69+
run: |
70+
${{ github.workspace }}/dependencies/Build-FFX-SDK.bat
71+
72+
# Only no loader version is built
73+
- name: Build dlssg-to-fsr3
74+
shell: pwsh
75+
run: |
76+
${{ github.workspace }}/Make-Release.ps1
77+
78+
- name: Extract the zip file
79+
shell: pwsh
80+
run: |
81+
$zipPath = Get-ChildItem "${{ github.workspace }}\bin\built-packages\" -Filter *.zip | Select-Object -First 1
82+
Expand-Archive -Path $zipPath.FullName -DestinationPath extracted-build
83+
84+
- name: Upload artifacts
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: dlssg-to-fsr3-${{ github.ref_name }}
88+
path: extracted-build/
89+
if-no-files-found: error

CMakeLists.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION_MAJOR
3232

3333
function(install_universal_variant PROXYDLL IMPLDLL ROOTDIR READMEDIR DLLNAME)
3434

35-
if (NOT DLLNAME STREQUAL "")
36-
install(FILES "$<TARGET_FILE:${PROXYDLL}>" DESTINATION "${ROOTDIR}/" RENAME "${DLLNAME}")
37-
else()
38-
install(TARGETS ${PROXYDLL} RUNTIME DESTINATION "${ROOTDIR}/")
35+
if (NOT PROXYDLL STREQUAL "")
36+
if (NOT DLLNAME STREQUAL "")
37+
install(FILES "$<TARGET_FILE:${PROXYDLL}>" DESTINATION "${ROOTDIR}/" RENAME "${DLLNAME}")
38+
else()
39+
install(TARGETS ${PROXYDLL} RUNTIME DESTINATION "${ROOTDIR}/")
40+
endif()
3941
endif()
42+
4043
install(TARGETS ${IMPLDLL} RUNTIME DESTINATION "${ROOTDIR}/")
41-
install(FILES "${PROJECT_RESOURCES_PATH}/${READMEDIR}" DESTINATION "${ROOTDIR}/" RENAME "READ ME.txt")
44+
45+
if (NOT READMEDIR STREQUAL "")
46+
install(FILES "${PROJECT_RESOURCES_PATH}/${READMEDIR}" DESTINATION "${ROOTDIR}/" RENAME "READ ME.txt")
47+
endif()
4248

4349
endfunction()
4450

@@ -73,6 +79,12 @@ elseif(BUILD_OUTPUT_WRAPPER STREQUAL "NVNGX")
7379
"/"
7480
)
7581

82+
elseif(BUILD_OUTPUT_WRAPPER STREQUAL "NOLOADER")
83+
84+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME} (No Loader)")
85+
86+
install_universal_variant("" dlssg_output_dll "" "" "")
87+
7688
endif()
7789

7890
install(

CMakePresets.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@
8282
"inherits": [
8383
"configuration-final"
8484
]
85+
},
86+
{
87+
"name": "final-noloader",
88+
"cacheVariables": {
89+
"BUILD_OUTPUT_WRAPPER": "NOLOADER"
90+
},
91+
"inherits": [
92+
"configuration-final"
93+
]
8594
}
8695
],
8796
"buildPresets": [
@@ -120,6 +129,18 @@
120129
"configurePreset": "final-nvngxwrapper",
121130
"configuration": "Release",
122131
"displayName": "Nvngx Release x64"
132+
},
133+
{
134+
"name": "final-noloader-debug",
135+
"configurePreset": "final-noloader",
136+
"configuration": "Debug",
137+
"displayName": "No Loader Debug x64"
138+
},
139+
{
140+
"name": "final-noloader-release",
141+
"configurePreset": "final-noloader",
142+
"configuration": "Release",
143+
"displayName": "No Loader Release x64"
123144
}
124145
],
125146
"packagePresets": [
@@ -140,6 +161,12 @@
140161
"displayName": "Package Final Nvngx",
141162
"configurePreset": "final-nvngxwrapper",
142163
"packageDirectory": "${sourceDir}/bin/built-packages"
164+
},
165+
{
166+
"name": "final-noloader",
167+
"displayName": "Package Final No Loader",
168+
"configurePreset": "final-noloader",
169+
"packageDirectory": "${sourceDir}/bin/built-packages"
143170
}
144171
]
145172
}

Make-Release.ps1

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ if ((Get-Command "cmake" -ErrorAction SilentlyContinue) -eq $null) {
99
}
1010

1111
# Then build with VS
12-
& cmake --preset final-dtwrapper
13-
& cmake --build --preset final-dtwrapper-release
14-
& cpack --preset final-dtwrapper
12+
# & cmake --preset final-dtwrapper
13+
# & cmake --build --preset final-dtwrapper-release
14+
# & cpack --preset final-dtwrapper
1515

16-
& cmake --preset final-nvngxwrapper
17-
& cmake --build --preset final-nvngxwrapper-release
18-
& cpack --preset final-nvngxwrapper
16+
# & cmake --preset final-nvngxwrapper
17+
# & cmake --build --preset final-nvngxwrapper-release
18+
# & cpack --preset final-nvngxwrapper
1919

20-
& cmake --preset final-universal
21-
& cmake --build --preset final-universal-release
22-
& cpack --preset final-universal
20+
# & cmake --preset final-universal
21+
# & cmake --build --preset final-universal-release
22+
# & cpack --preset final-universal
23+
24+
& cmake --preset final-noloader
25+
& cmake --build --preset final-noloader-release
26+
& cpack --preset final-noloader

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
## OptiScaler specific
2+
Builds in this repo are provided to ease the use with OptiScaler.
3+
14
**dlssg-to-fsr3** is a drop-in mod/replacement for games utilizing [Nvidia's DLSS-G Frame Generation](https://nvidianews.nvidia.com/news/nvidia-introduces-dlss-3-with-breakthrough-ai-powered-frame-generation-for-up-to-4x-performance) technology that allows people to use [AMD's FSR 3 Frame Generation](https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK) technology instead. Only RTX 1600, RTX 2000, and RTX 3000 series GPUs are supported.
25

36
Game-specific compatibility can be [found here](https://github.com/Nukem9/dlssg-to-fsr3/wiki/Game-Compatibility-List). Using dlssg-to-fsr3 in multiplayer games is ill advised and may lead to account bans. **Use at your own risk.**
47

5-
## Download Link
8+
<!-- ## Download Link
69
7-
[https://www.nexusmods.com/site/mods/738](https://www.nexusmods.com/site/mods/738?tab=files)
10+
[https://www.nexusmods.com/site/mods/738](https://www.nexusmods.com/site/mods/738?tab=files) -->
811

912
## Installation for Users
1013

resources/binary_dist_license.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Binary distributions copyright (c) Nukem <Nukem at outlook.com>. All rights reserved.
2-
Binary distributions are found at https://www.nexusmods.com/site/mods/738 or https://github.com/Nukem9/dlssg-to-fsr3.
3-
41
=================================================================================
52
============================= Third Party Licenses ==============================
63
=================================================================================

source/maindll/DllMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
4545

4646
spdlog::warn("");
4747
spdlog::warn(
48-
"dlssg-to-fsr3 v{}.{} loaded. AMD FSR 3.1 Frame Generation will replace Nvidia DLSS-G Frame Generation. Note this does NOT "
48+
"dlssg-to-fsr3 v{}.{} (OptiScaler build) loaded. AMD FSR 3.1 Frame Generation will replace Nvidia DLSS-G Frame Generation. Note this does NOT "
4949
"represent a native",
5050
BUILD_VERSION_MAJOR,
5151
BUILD_VERSION_MINOR);

0 commit comments

Comments
 (0)