Skip to content

Commit

Permalink
Add DLAA as DLSS highest option
Browse files Browse the repository at this point in the history
  • Loading branch information
sultim-t committed Aug 6, 2023
1 parent 40599c4 commit 7cea82c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
1 change: 1 addition & 0 deletions Include/RTGL1/RTGL1.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ typedef enum RgRenderResolutionMode
RG_RENDER_RESOLUTION_MODE_PERFORMANCE,
RG_RENDER_RESOLUTION_MODE_BALANCED,
RG_RENDER_RESOLUTION_MODE_QUALITY,
RG_RENDER_RESOLUTION_MODE_DLAA, // Only available with DLSS
} RgRenderResolutionMode;

typedef struct RgDrawFrameRenderResolutionParams
Expand Down
1 change: 1 addition & 0 deletions Source/DLSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ sl::DLSSMode ToSlPerfQuality( RgRenderResolutionMode mode )
case RG_RENDER_RESOLUTION_MODE_PERFORMANCE: return sl::DLSSMode::eMaxPerformance;
case RG_RENDER_RESOLUTION_MODE_BALANCED: return sl::DLSSMode::eBalanced;
case RG_RENDER_RESOLUTION_MODE_QUALITY: return sl::DLSSMode::eMaxQuality;
case RG_RENDER_RESOLUTION_MODE_DLAA: return sl::DLSSMode::eDLAA;
default: assert( 0 ); return sl::DLSSMode::eBalanced;
}
}
Expand Down
9 changes: 8 additions & 1 deletion Source/RenderResolutionHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class RenderResolutionHelper
case RG_RENDER_RESOLUTION_MODE_ULTRA_PERFORMANCE:
case RG_RENDER_RESOLUTION_MODE_PERFORMANCE:
case RG_RENDER_RESOLUTION_MODE_BALANCED:
case RG_RENDER_RESOLUTION_MODE_QUALITY: break;
case RG_RENDER_RESOLUTION_MODE_QUALITY:
case RG_RENDER_RESOLUTION_MODE_DLAA: break;
default:
throw RgException(
RG_RESULT_WRONG_FUNCTION_ARGUMENT,
Expand All @@ -96,6 +97,12 @@ class RenderResolutionHelper

if( upscaleTechnique == RG_RENDER_UPSCALE_TECHNIQUE_AMD_FSR2 )
{
if( resolutionMode == RG_RENDER_RESOLUTION_MODE_DLAA )
{
debug::Error( "RG_RENDER_RESOLUTION_MODE_DLAA must not be used with FSR2" );
resolutionMode = RG_RENDER_RESOLUTION_MODE_QUALITY;
}

if( resolutionMode == RG_RENDER_RESOLUTION_MODE_CUSTOM )
{
renderWidth = params.customRenderSize.width;
Expand Down
52 changes: 29 additions & 23 deletions Source/VulkanDevice_Dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ void RTGL1::VulkanDevice::Dev_Draw() const
ImGui::RadioButton( "Quality##Resolution",
reinterpret_cast< int* >( &modifiers.resolutionMode ),
RG_RENDER_RESOLUTION_MODE_QUALITY );
ImGui::SameLine();
if( modifiers.upscaleTechnique == RG_RENDER_UPSCALE_TECHNIQUE_NVIDIA_DLSS )
{
ImGui::SameLine();
ImGui::RadioButton( "DLAA##Resolution",
reinterpret_cast< int* >( &modifiers.resolutionMode ),
RG_RENDER_RESOLUTION_MODE_DLAA );
}
ImGui::EndDisabled();
}
{
Expand Down Expand Up @@ -522,37 +528,37 @@ void RTGL1::VulkanDevice::Dev_Draw() const

std::deque< MsgEntry > msgs;
{
auto l = std::lock_guard( devmodeMutex );
for( auto& [ severity, text, hash ] : devmode->logs | std::ranges::views::reverse )
{
bool found = false;

if( devmode->logCompact )
auto l = std::lock_guard( devmodeMutex );
for( auto& [ severity, text, hash ] : devmode->logs | std::ranges::views::reverse )
{
for( auto& existing : msgs )
bool found = false;

if( devmode->logCompact )
{
if( severity == existing.severity && hash == existing.hash &&
text == existing.text )
for( auto& existing : msgs )
{
existing.count++;
if( severity == existing.severity && hash == existing.hash &&
text == existing.text )
{
existing.count++;

found = true;
break;
found = true;
break;
}
}
}
}

if( !found )
{
msgs.emplace_front( MsgEntry{
.count = 1,
.severity = severity,
.text = text,
.hash = std::hash< std::string_view >{}( text ),
} );
if( !found )
{
msgs.emplace_front( MsgEntry{
.count = 1,
.severity = severity,
.text = text,
.hash = std::hash< std::string_view >{}( text ),
} );
}
}
}
}


if( ImGui::BeginChild( "##LogScrollingRegion",
Expand Down

0 comments on commit 7cea82c

Please sign in to comment.