Skip to content

Commit 18b5abb

Browse files
Simplify super-resolution initialization
1 parent e5bfc09 commit 18b5abb

17 files changed

+502
-980
lines changed

BuildTools/.NET/dotnet-build-package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def cmake_build_project(config, settings):
148148
subprocess.run(f"cmake -S . -B {settings['native-build-folder']} \
149149
-D CMAKE_BUILD_TYPE={config} \
150150
-D CMAKE_INSTALL_PREFIX={settings['native-build-folder']}/install -A {settings['cmake-generator-attribute']} \
151-
-D DILIGENT_BUILD_CORE_TESTS=ON", check=True)
151+
-D DILIGENT_BUILD_CORE_TESTS=ON -D DILIGENT_NO_DLSS=ON -D DILIGENT_NO_DSR=ON", check=True)
152152
subprocess.run(f"cmake --build {settings['native-build-folder']} --target install --config {config}", check=True)
153153

154154
native_dll_path = f"{project_paths['dotnet-build']}/{project_paths['dotnet-proj']}/native/{settings['nuget-name-folder']}"

Graphics/SuperResolution/CMakeLists.txt

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ project(Diligent-SuperResolution CXX)
77
set(DILIGENT_DLSS_SUPPORTED FALSE CACHE INTERNAL "DLSS is not supported")
88
set(DILIGENT_DSR_SUPPORTED FALSE CACHE INTERNAL "DirectSR is not supported")
99

10-
if(PLATFORM_WIN32)
11-
set(DILIGENT_DLSS_SUPPORTED TRUE CACHE INTERNAL "DLSS is supported on Win32 platform")
12-
set(DILIGENT_DSR_SUPPORTED TRUE CACHE INTERNAL "DirectSR is supported on Win32 platform")
10+
if(PLATFORM_WIN32 AND NOT MINGW_BUILD)
11+
if (D3D11_SUPPORTED OR D3D12_SUPPORTED OR VULKAN_SUPPORTED)
12+
set(DILIGENT_DLSS_SUPPORTED TRUE CACHE INTERNAL "DLSS is supported on Win32 platform")
13+
endif()
14+
if (D3D12_SUPPORTED)
15+
set(DILIGENT_DSR_SUPPORTED TRUE CACHE INTERNAL "DirectSR is supported on Win32 platform")
16+
endif()
1317
endif()
1418

1519
if(${DILIGENT_NO_DLSS})
@@ -42,12 +46,8 @@ endif()
4246

4347
set(INCLUDE
4448
include/SuperResolutionBase.hpp
45-
include/SuperResolutionFactoryBase.hpp
4649
include/SuperResolutionVariants.hpp
47-
include/DLSSProviderD3D12.hpp
48-
include/DLSSProviderD3D11.hpp
49-
include/DLSSProviderVk.hpp
50-
include/DSRProviderD3D12.hpp
50+
include/SuperResolutionProvider.hpp
5151
)
5252

5353
set(INTERFACE
@@ -58,21 +58,27 @@ set(INTERFACE
5858

5959
set(SOURCE
6060
src/SuperResolutionBase.cpp
61-
src/SuperResolutionFactoryBase.cpp
6261
src/SuperResolutionFactory.cpp
63-
src/SuperResolutionFactoryD3D12.cpp
64-
src/SuperResolutionFactoryD3D11.cpp
65-
src/SuperResolutionFactoryVk.cpp
66-
src/SuperResolutionFactoryMtl.cpp
67-
src/DLSSProviderD3D12.cpp
68-
src/DLSSProviderD3D11.cpp
69-
src/DLSSProviderVk.cpp
70-
src/DSRProviderD3D12.cpp
7162
)
7263

7364
if(DILIGENT_DLSS_SUPPORTED)
7465
list(APPEND INCLUDE include/SuperResolutionDLSS.hpp)
7566
list(APPEND SOURCE src/SuperResolutionDLSS.cpp)
67+
if (D3D11_SUPPORTED)
68+
list(APPEND SOURCE src/DLSSProviderD3D11.cpp)
69+
endif()
70+
if (D3D12_SUPPORTED)
71+
list(APPEND SOURCE src/DLSSProviderD3D12.cpp)
72+
endif()
73+
if (VULKAN_SUPPORTED)
74+
list(APPEND SOURCE src/DLSSProviderVk.cpp)
75+
endif()
76+
endif()
77+
78+
if (DILIGENT_DSR_SUPPORTED)
79+
if (D3D12_SUPPORTED)
80+
list(APPEND SOURCE src/DSRProviderD3D12.cpp)
81+
endif()
7682
endif()
7783

7884
set(DLL_SOURCE
@@ -106,11 +112,21 @@ PRIVATE
106112
)
107113

108114
if(DILIGENT_DLSS_SUPPORTED)
109-
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DLSS_SUPPORTED=1)
115+
if (D3D11_SUPPORTED)
116+
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DLSS_D3D11_SUPPORTED=1)
117+
endif()
118+
if (D3D12_SUPPORTED)
119+
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DLSS_D3D12_SUPPORTED=1)
120+
endif()
121+
if (VULKAN_SUPPORTED)
122+
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DLSS_VK_SUPPORTED=1)
123+
endif()
110124
endif()
111125

112126
if(DILIGENT_DSR_SUPPORTED)
113-
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DSR_SUPPORTED=1)
127+
if (D3D12_SUPPORTED)
128+
target_compile_definitions(Diligent-SuperResolution-static PRIVATE DILIGENT_DSR_D3D12_SUPPORTED=1)
129+
endif()
114130
endif()
115131

116132
target_compile_definitions(Diligent-SuperResolution-shared PUBLIC DILIGENT_SUPER_RESOLUTION_SHARED=1)

Graphics/SuperResolution/include/DLSSProviderD3D11.hpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

Graphics/SuperResolution/include/DLSSProviderD3D12.hpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

Graphics/SuperResolution/include/DSRProviderD3D12.hpp

Lines changed: 0 additions & 60 deletions
This file was deleted.

Graphics/SuperResolution/include/SuperResolutionFactoryBase.hpp

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)