diff --git a/extern/FidelityFX-SDK b/extern/FidelityFX-SDK index 8e1099cf5..3ddcc3097 160000 --- a/extern/FidelityFX-SDK +++ b/extern/FidelityFX-SDK @@ -1 +1 @@ -Subproject commit 8e1099cf599f32b2a6294241a83e656df7db7f2e +Subproject commit 3ddcc3097a3b70aa1896bcc87ea7ac05a4bf9fef diff --git a/src/FidelityFX.cpp b/src/FidelityFX.cpp index d05700d42..7918a8f1f 100644 --- a/src/FidelityFX.cpp +++ b/src/FidelityFX.cpp @@ -48,7 +48,6 @@ void FidelityFX::CreateFSRResources() contextDescription.backBufferFormat = FFX_SURFACE_FORMAT_R8G8B8A8_UNORM; contextDescription.backendInterfaceUpscaling = fsrInterface; - contextDescription.backendInterfaceFrameInterpolation = fsrInterface; if (ffxFsr3ContextCreate(&fsrContext, &contextDescription) != FFX_OK) logger::critical("[FidelityFX] Failed to initialize FSR3 context!"); @@ -110,13 +109,15 @@ void FidelityFX::Upscale(Texture2D* a_color) dispatchParameters.cameraNear = cameraNear; dispatchParameters.enableSharpening = true; - dispatchParameters.sharpness = 0.0f; + dispatchParameters.sharpness = Upscaling::GetSingleton()->settings.sharpness; dispatchParameters.cameraFovAngleVertical = GetVerticalFOVRad(); dispatchParameters.viewSpaceToMetersFactor = 0.01428222656f; dispatchParameters.reset = false; dispatchParameters.preExposure = 1.0f; + dispatchParameters.flags = 0; + FfxErrorCode errorCode = ffxFsr3ContextDispatchUpscale(&fsrContext, &dispatchParameters); if (errorCode != FFX_OK) { logger::error("[FidelityFX] Failed to dispatch upscaling!"); diff --git a/src/Upscaling.cpp b/src/Upscaling.cpp index 639f101ee..eff282a14 100644 --- a/src/Upscaling.cpp +++ b/src/Upscaling.cpp @@ -144,40 +144,42 @@ void Upscaling::Upscale() else FidelityFX::GetSingleton()->Upscale(upscalingTempTexture); - context->CopyResource(inputTextureResource, upscalingTempTexture->resource.get()); - state->EndPerfEvent(); - state->BeginPerfEvent("Sharpening"); + if (GetUpscaleMode() != UpscaleMode::kFSR) { + state->BeginPerfEvent("Sharpening"); - { - auto dispatchCount = Util::GetScreenDispatchCount(false); + context->CopyResource(inputTextureResource, upscalingTempTexture->resource.get()); { - ID3D11ShaderResourceView* views[1] = { inputTextureSRV }; - context->CSSetShaderResources(0, ARRAYSIZE(views), views); + auto dispatchCount = Util::GetScreenDispatchCount(false); - ID3D11UnorderedAccessView* uavs[1] = { upscalingTempTexture->uav.get() }; - context->CSSetUnorderedAccessViews(0, ARRAYSIZE(uavs), uavs, nullptr); + { + ID3D11ShaderResourceView* views[1] = { inputTextureSRV }; + context->CSSetShaderResources(0, ARRAYSIZE(views), views); - context->CSSetShader(GetRCASComputeShader(), nullptr, 0); + ID3D11UnorderedAccessView* uavs[1] = { upscalingTempTexture->uav.get() }; + context->CSSetUnorderedAccessViews(0, ARRAYSIZE(uavs), uavs, nullptr); - context->Dispatch(dispatchCount.x, dispatchCount.y, 1); - } + context->CSSetShader(GetRCASComputeShader(), nullptr, 0); - ID3D11ShaderResourceView* views[1] = { nullptr }; - context->CSSetShaderResources(0, ARRAYSIZE(views), views); + context->Dispatch(dispatchCount.x, dispatchCount.y, 1); + } - ID3D11UnorderedAccessView* uavs[1] = { nullptr }; - context->CSSetUnorderedAccessViews(0, ARRAYSIZE(uavs), uavs, nullptr); + ID3D11ShaderResourceView* views[1] = { nullptr }; + context->CSSetShaderResources(0, ARRAYSIZE(views), views); - ID3D11ComputeShader* shader = nullptr; - context->CSSetShader(shader, nullptr, 0); + ID3D11UnorderedAccessView* uavs[1] = { nullptr }; + context->CSSetUnorderedAccessViews(0, ARRAYSIZE(uavs), uavs, nullptr); + + ID3D11ComputeShader* shader = nullptr; + context->CSSetShader(shader, nullptr, 0); + } + + state->EndPerfEvent(); } context->CopyResource(outputTextureResource, upscalingTempTexture->resource.get()); - - state->EndPerfEvent(); } void Upscaling::CreateUpscalingResources()