@@ -270,15 +270,8 @@ void Streamline::CheckFrameConstants()
270270 }
271271}
272272
273- void Streamline::Upscale (ID3D11Resource* a_upscalingTexture, ID3D11Resource* a_reactiveMask, ID3D11Resource* a_transparencyCompositionMask, ID3D11Resource* a_motionVectors )
273+ void Streamline::SetDLSSOptions ( )
274274{
275- CheckFrameConstants ();
276-
277- auto state = globals::state;
278-
279- auto renderer = globals::game::renderer;
280- auto & depthTexture = renderer->GetDepthStencilData ().depthStencils [RE::RENDER_TARGETS_DEPTHSTENCIL::kMAIN ];
281-
282275 sl::DLSSOptions dlssOptions{};
283276
284277 // Map quality mode to DLSS mode
@@ -301,6 +294,8 @@ void Streamline::Upscale(ID3D11Resource* a_upscalingTexture, ID3D11Resource* a_r
301294 break ;
302295 }
303296
297+ auto state = globals::state;
298+
304299 dlssOptions.outputWidth = (uint)state->screenSize .x ;
305300 dlssOptions.outputHeight = (uint)state->screenSize .y ;
306301 dlssOptions.colorBuffersHDR = sl::Boolean::eTrue;
@@ -318,6 +313,17 @@ void Streamline::Upscale(ID3D11Resource* a_upscalingTexture, ID3D11Resource* a_r
318313 if (SL_FAILED (result, slDLSSSetOptions (viewport, dlssOptions))) {
319314 logger::critical (" [Streamline] Could not enable DLSS" );
320315 }
316+ }
317+
318+ void Streamline::Upscale (ID3D11Resource* a_upscalingTexture, ID3D11Resource* a_reactiveMask, ID3D11Resource* a_transparencyCompositionMask, ID3D11Resource* a_motionVectors)
319+ {
320+ CheckFrameConstants ();
321+ SetDLSSOptions ();
322+
323+ auto state = globals::state;
324+
325+ auto renderer = globals::game::renderer;
326+ auto & depthTexture = renderer->GetDepthStencilData ().depthStencils [RE::RENDER_TARGETS_DEPTHSTENCIL::kMAIN ];
321327
322328 {
323329 auto screenSize = state->screenSize ;
@@ -352,7 +358,7 @@ void Streamline::Upscale(ID3D11Resource* a_upscalingTexture, ID3D11Resource* a_r
352358 slEvaluateFeature (sl::kFeatureDLSS , *frameToken, inputs, _countof (inputs), globals::d3d::context);
353359}
354360
355- float Streamline::GetInputResolutionScale (uint32_t outputWidth, uint32_t outputHeight, uint32_t qualityMode)
361+ float2 Streamline::GetInputResolutionScale (uint32_t outputWidth, uint32_t outputHeight, uint32_t qualityMode)
356362{
357363 sl::DLSSMode dlssMode;
358364 switch (qualityMode) {
@@ -382,7 +388,7 @@ float Streamline::GetInputResolutionScale(uint32_t outputWidth, uint32_t outputH
382388 sl::Result result = slDLSSGetOptimalSettings (dlssOptions, optimalSettings);
383389 if (result != sl::Result::eOk) {
384390 logger::critical (" [Streamline] Failed to get DLSS optimal settings, error code: {}" , (int )result);
385- return 1 .0f ;
391+ return { 1 .0f , 1 . 0f } ;
386392 }
387393
388394 float scaleX;
@@ -398,8 +404,8 @@ float Streamline::GetInputResolutionScale(uint32_t outputWidth, uint32_t outputH
398404 scaleY = (float )optimalSettings.optimalRenderHeight / (float )outputHeight;
399405 }
400406
401- // Use the average scale (both should be the same for uniform scaling)
402- return ( scaleX + scaleY) * 0 . 5f ;
407+ // Return separate X and Y scales for more precision
408+ return { scaleX, scaleY } ;
403409}
404410
405411/* *
0 commit comments