|
|
|
@ -88,7 +88,7 @@ namespace FidelityFX |
|
|
|
_firstExecution = true; |
|
|
|
_resourceFrameIndex = 0; |
|
|
|
|
|
|
|
UpscalerConsts.displaySize = _contextDescription.DisplaySize; |
|
|
|
UpscalerConsts.displaySize = _contextDescription.MaxUpscaleSize; |
|
|
|
|
|
|
|
_resources.Create(_contextDescription); |
|
|
|
CreatePasses(); |
|
|
|
@ -192,8 +192,8 @@ namespace FidelityFX |
|
|
|
const int threadGroupWorkRegionDim = 8; |
|
|
|
int dispatchSrcX = (UpscalerConsts.renderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
int dispatchSrcY = (UpscalerConsts.renderSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
int dispatchDstX = (_contextDescription.DisplaySize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
int dispatchDstY = (_contextDescription.DisplaySize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
int dispatchDstX = (_contextDescription.MaxUpscaleSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
int dispatchDstY = (_contextDescription.MaxUpscaleSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
|
|
|
|
// Clear reconstructed depth for max depth store
|
|
|
|
if (resetAccumulation) |
|
|
|
@ -313,7 +313,7 @@ namespace FidelityFX |
|
|
|
constants.jitterOffset = dispatchParams.JitterOffset; |
|
|
|
constants.renderSize = dispatchParams.RenderSize; |
|
|
|
constants.maxRenderSize = _contextDescription.MaxRenderSize; |
|
|
|
constants.inputColorResourceDimensions = dispatchParams.InputResourceSize; |
|
|
|
constants.inputColorResourceDimensions = dispatchParams.UpscaleSize; |
|
|
|
|
|
|
|
// Compute the horizontal FOV for the shader from the vertical one
|
|
|
|
float aspectRatio = (float)dispatchParams.RenderSize.x / dispatchParams.RenderSize.y; |
|
|
|
@ -325,7 +325,7 @@ namespace FidelityFX |
|
|
|
constants.deviceToViewDepth = SetupDeviceDepthToViewSpaceDepthParams(dispatchParams); |
|
|
|
|
|
|
|
// To be updated if resource is larger than the actual image size
|
|
|
|
constants.downscaleFactor = new Vector2((float)constants.renderSize.x / _contextDescription.DisplaySize.x, (float)constants.renderSize.y / _contextDescription.DisplaySize.y); |
|
|
|
constants.downscaleFactor = new Vector2((float)constants.renderSize.x / _contextDescription.MaxUpscaleSize.x, (float)constants.renderSize.y / _contextDescription.MaxUpscaleSize.y); |
|
|
|
constants.previousFramePreExposure = constants.preExposure; |
|
|
|
constants.preExposure = (dispatchParams.PreExposure != 0) ? dispatchParams.PreExposure : 1.0f; |
|
|
|
|
|
|
|
@ -340,7 +340,7 @@ namespace FidelityFX |
|
|
|
_previousJitterOffset = constants.jitterOffset; |
|
|
|
} |
|
|
|
|
|
|
|
int jitterPhaseCount = Fsr3Upscaler.GetJitterPhaseCount(dispatchParams.RenderSize.x, _contextDescription.DisplaySize.x); |
|
|
|
int jitterPhaseCount = Fsr3Upscaler.GetJitterPhaseCount(dispatchParams.RenderSize.x, _contextDescription.MaxUpscaleSize.x); |
|
|
|
if (resetAccumulation || constants.jitterPhaseCount == 0) |
|
|
|
{ |
|
|
|
constants.jitterPhaseCount = jitterPhaseCount; |
|
|
|
|