Browse Source

Added a dummy field to the main FSR2 constant buffer, to make it exactly 128 bytes long. This fixes a data alignment issue on iOS Metal.

hdrp
Nico de Poel 3 years ago
parent
commit
73346a5054
  1. 2
      Assets/Resources/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h
  2. 2
      Assets/Scripts/Core/Fsr2.cs

2
Assets/Resources/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h

@ -71,6 +71,8 @@
FfxFloat32 fDeltaTime; FfxFloat32 fDeltaTime;
FfxFloat32 fDynamicResChangeFactor; FfxFloat32 fDynamicResChangeFactor;
FfxFloat32 fViewSpaceToMetersFactor; FfxFloat32 fViewSpaceToMetersFactor;
FfxInt32 iDummy;
}; };
#define FFX_FSR2_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR2) / 4) // Number of 32-bit values. This must be kept in sync with the cbFSR2 size. #define FFX_FSR2_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR2) / 4) // Number of 32-bit values. This must be kept in sync with the cbFSR2 size.

2
Assets/Scripts/Core/Fsr2.cs

@ -231,6 +231,8 @@ namespace FidelityFX
public float deltaTime; public float deltaTime;
public float dynamicResChangeFactor; public float dynamicResChangeFactor;
public float viewSpaceToMetersFactor; public float viewSpaceToMetersFactor;
public int dummy;
} }
[Serializable, StructLayout(LayoutKind.Sequential)] [Serializable, StructLayout(LayoutKind.Sequential)]

Loading…
Cancel
Save