|
|
|
@ -7,6 +7,29 @@ namespace FidelityFX.FrameGen |
|
|
|
{ |
|
|
|
public static class FrameInterpolation |
|
|
|
{ |
|
|
|
public static FrameInterpolationContext CreateContext(Vector2Int displaySize, Vector2Int maxRenderSize, FrameInterpolationShaders shaders, GraphicsFormat backBufferFormat, InitializationFlags flags = 0) |
|
|
|
{ |
|
|
|
if (SystemInfo.usesReversedZBuffer) |
|
|
|
flags |= InitializationFlags.EnableDepthInverted; |
|
|
|
else |
|
|
|
flags &= ~InitializationFlags.EnableDepthInverted; |
|
|
|
|
|
|
|
var contextDescription = new ContextDescription |
|
|
|
{ |
|
|
|
flags = flags, |
|
|
|
maxRenderSize = maxRenderSize, |
|
|
|
displaySize = displaySize, |
|
|
|
backBufferFormat = backBufferFormat, |
|
|
|
shaders = shaders, |
|
|
|
}; |
|
|
|
|
|
|
|
Debug.Log($"Setting up Frame Interpolation with render size: {maxRenderSize.x}x{maxRenderSize.y}, display size: {displaySize.x}x{displaySize.y}, backbuffer format: {backBufferFormat}, flags: {flags}"); |
|
|
|
|
|
|
|
var context = new FrameInterpolationContext(); |
|
|
|
context.Create(contextDescription); |
|
|
|
return context; |
|
|
|
} |
|
|
|
|
|
|
|
public struct ContextDescription |
|
|
|
{ |
|
|
|
public InitializationFlags flags; |
|
|
|
|