Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Graphics/SuperResolution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(Diligent-SuperResolution CXX)
set(DILIGENT_DLSS_SUPPORTED FALSE CACHE INTERNAL "DLSS is not supported")
set(DILIGENT_DSR_SUPPORTED FALSE CACHE INTERNAL "DirectSR is not supported")

if(PLATFORM_WIN32 AND NOT MINGW_BUILD)
if(PLATFORM_WIN32 AND NOT MINGW_BUILD AND CMAKE_SIZEOF_VOID_P EQUAL 8)
if (D3D11_SUPPORTED OR D3D12_SUPPORTED OR VULKAN_SUPPORTED)
set(DILIGENT_DLSS_SUPPORTED TRUE CACHE INTERNAL "DLSS is supported on Win32 platform")
endif()
Expand Down Expand Up @@ -38,8 +38,8 @@ endif()
if(DILIGENT_DLSS_SUPPORTED)
# Fetch NVIDIA DLSS SDK headers
FetchContent_DeclareShallowGit(DLSS-Headers
GIT_REPOSITORY https://github.com/NVIDIA/DLSS.git
GIT_TAG main
GIT_REPOSITORY https://github.com/MikhailGorobets/DLSS-Headers.git
GIT_TAG master
)
FetchContent_MakeAvailable(DLSS-Headers)
endif()
Expand Down Expand Up @@ -147,14 +147,7 @@ if(DILIGENT_DSR_SUPPORTED)
endif()

if(DILIGENT_DLSS_SUPPORTED)
set(DLSS_SDK_DIR ${FETCHCONTENT_BASE_DIR}/dlss-headers-src)
target_include_directories(Diligent-SuperResolution-static PRIVATE ${DLSS_SDK_DIR}/include)

# Link NGX static library (dynamic CRT /MD variant)
target_link_libraries(Diligent-SuperResolution-static PRIVATE
debug ${DLSS_SDK_DIR}/lib/Windows_x86_64/x64/nvsdk_ngx_d_dbg.lib
optimized ${DLSS_SDK_DIR}/lib/Windows_x86_64/x64/nvsdk_ngx_d.lib
)
target_link_libraries(Diligent-SuperResolution-static PRIVATE DLSS-Headers DLSS-NGX)

if(D3D12_SUPPORTED)
target_link_libraries(Diligent-SuperResolution-static PRIVATE Diligent-GraphicsEngineD3D12-static)
Expand Down
16 changes: 10 additions & 6 deletions Graphics/SuperResolution/include/SuperResolutionBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace Diligent

#define LOG_SUPER_RESOLUTION_ERROR_AND_THROW(Name, ...) LOG_ERROR_AND_THROW("Super resolution upscaler '", ((Name) != nullptr ? (Name) : ""), "': ", ##__VA_ARGS__)

#define DEV_CHECK_SUPER_RESOLUTION(Name, Expr, ...) DEV_CHECK_ERR(Expr, "Super resolution upscaler '", ((Name) != nullptr ? (Name) : ""), "': ", ##__VA_ARGS__)

#define VERIFY_SUPER_RESOLUTION(Name, Expr, ...) \
do \
{ \
Expand All @@ -48,22 +50,24 @@ namespace Diligent
} \
} while (false)



/// Validates super resolution description and throws an exception in case of an error.
void ValidateSuperResolutionDesc(const SuperResolutionDesc& Desc) noexcept(false);

/// Validates super resolution description for temporal upscaling and throws an exception in case of an error.
void ValidateTemporalSuperResolutionDesc(const SuperResolutionDesc& Desc) noexcept(false);

/// Validates super resolution source settings attributes and throws an exception in case of an error.
void ValidateSourceSettingsAttribs(const SuperResolutionSourceSettingsAttribs& Attribs) noexcept(false);
/// Validates super resolution source settings attributes using DEV checks.
void ValidateSourceSettingsAttribs(const SuperResolutionSourceSettingsAttribs& Attribs);

/// Validates execute super resolution attributes and throws an exception in case of an error.
/// Validates execute super resolution attributes using DEV checks.
void ValidateExecuteSuperResolutionAttribs(const SuperResolutionDesc& Desc,
const ExecuteSuperResolutionAttribs& Attribs) noexcept(false);
const ExecuteSuperResolutionAttribs& Attribs);

/// Validates execute super resolution attributes for temporal upscaling and throws an exception in case of an error.
/// Validates execute super resolution attributes for temporal upscaling using DEV checks.
void ValidateTemporalExecuteSuperResolutionAttribs(const SuperResolutionDesc& Desc,
const ExecuteSuperResolutionAttribs& Attribs) noexcept(false);
const ExecuteSuperResolutionAttribs& Attribs);

class SuperResolutionBase : public ObjectBase<ISuperResolution>
{
Expand Down
8 changes: 4 additions & 4 deletions Graphics/SuperResolution/src/DSRProviderD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ SuperResolutionD3D12_DSR::~SuperResolutionD3D12_DSR() = default;
void DILIGENT_CALL_TYPE SuperResolutionD3D12_DSR::Execute(const ExecuteSuperResolutionAttribs& Attribs)
{
ValidateTemporalExecuteSuperResolutionAttribs(m_Desc, Attribs);
VERIFY_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraNear > 0, "CameraNear must be greater than zero for temporal upscaling");
VERIFY_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraFar > 0, "CameraFar must be greater than zero for temporal upscaling.");
VERIFY_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraFovAngleVert > 0, "CameraFovAngleVert must be greater than zero for temporal upscaling.");
VERIFY_SUPER_RESOLUTION(m_Desc.Name, Attribs.TimeDeltaInSeconds >= 0, "TimeDeltaInSeconds must be non-negative.");
DEV_CHECK_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraNear > 0, "CameraNear must be greater than zero for temporal upscaling");
DEV_CHECK_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraFar > 0, "CameraFar must be greater than zero for temporal upscaling.");
DEV_CHECK_SUPER_RESOLUTION(m_Desc.Name, Attribs.CameraFovAngleVert > 0, "CameraFovAngleVert must be greater than zero for temporal upscaling.");
DEV_CHECK_SUPER_RESOLUTION(m_Desc.Name, Attribs.TimeDeltaInSeconds >= 0, "TimeDeltaInSeconds must be non-negative.");

DeviceContextD3D12Impl* pCtx = ClassPtrCast<DeviceContextD3D12Impl>(Attribs.pContext);

Expand Down
Loading
Loading