Browse Source

Fixed a couple of incorrect sizes

fsr3.1
Nico de Poel 2 years ago
parent
commit
60336253b7
  1. 6
      Assets/Scripts/Core/Fsr3UpscalerContext.cs
  2. 2
      Assets/Scripts/Fsr3UpscalerImageEffect.cs

6
Assets/Scripts/Core/Fsr3UpscalerContext.cs

@ -204,8 +204,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.MaxUpscaleSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchDstY = (_contextDescription.MaxUpscaleSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchDstX = (UpscalerConsts.upscaleSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchDstY = (UpscalerConsts.upscaleSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchShadingChangePassX = ((UpscalerConsts.renderSize.x / 2) + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchShadingChangePassY = ((UpscalerConsts.renderSize.y / 2) + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -344,7 +344,7 @@ namespace FidelityFX
}
// To be updated if resource is larger than the actual image size
constants.downscaleFactor = new Vector2((float)constants.renderSize.x / _contextDescription.MaxUpscaleSize.x, (float)constants.renderSize.y / _contextDescription.MaxUpscaleSize.y);
constants.downscaleFactor = new Vector2((float)constants.renderSize.x / constants.upscaleSize.x, (float)constants.renderSize.y / constants.upscaleSize.y);
// Calculate pre-exposure relevant factors
constants.deltaPreExposure = 1.0f;

2
Assets/Scripts/Fsr3UpscalerImageEffect.cs

@ -391,7 +391,7 @@ namespace FidelityFX
_renderCamera.ResetProjectionMatrix();
// Update the input resource descriptions
_dispatchDescription.UpscaleSize = new Vector2Int(src.width, src.height);
_dispatchDescription.UpscaleSize = new Vector2Int(_renderCamera.pixelWidth, _renderCamera.pixelHeight);
_dispatchCommandBuffer.Clear();

Loading…
Cancel
Save