diff --git a/Runtime/OpticalFlow/OpticalFlow.cs b/Runtime/OpticalFlow/OpticalFlow.cs new file mode 100644 index 0000000..b09884c --- /dev/null +++ b/Runtime/OpticalFlow/OpticalFlow.cs @@ -0,0 +1,55 @@ +using System; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace FidelityFX.OpticalFlow +{ + public static class OpticalFlow + { + public static OpticalFlowContext CreateContext(in ContextDescription contextDescription) + { + throw new NotImplementedException(); + } + + public struct ContextDescription + { + public Vector2Int resolution; + } + + public struct DispatchDescription + { + public ResourceView color; + public ResourceView opticalFlowVector; + public ResourceView opticalFlowSCD; + public bool reset; + public int backbufferTransferFunction; + public Vector2 minMaxLuminance; + } + + [Serializable, StructLayout(LayoutKind.Sequential)] + internal struct OpticalFlowConstants + { + public Vector2Int inputLumaResolution; + public uint opticalFlowPyramidLevel; + public uint opticalFlowPyramidLevelCount; + + public int frameIndex; + public uint backbufferTransferFunction; + public Vector2 minMaxLuminance; + } + + [Serializable, StructLayout(LayoutKind.Sequential)] + internal struct SpdConstants + { + public uint mips; + public uint numWorkGroups; + public uint workGroupOffsetX; + public uint workGroupOffsetY; + + public uint numWorkGroupsOpticalFlowInputPyramid; + public uint pad0_; + public uint pad1_; + public uint pad2_; + } + } +} diff --git a/Runtime/OpticalFlow/OpticalFlow.cs.meta b/Runtime/OpticalFlow/OpticalFlow.cs.meta new file mode 100644 index 0000000..811f536 --- /dev/null +++ b/Runtime/OpticalFlow/OpticalFlow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb98adb74c696524e900d3b0b965e1dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OpticalFlow/OpticalFlowAssets.cs b/Runtime/OpticalFlow/OpticalFlowAssets.cs index 105cc43..6f2871f 100644 --- a/Runtime/OpticalFlow/OpticalFlowAssets.cs +++ b/Runtime/OpticalFlow/OpticalFlowAssets.cs @@ -75,12 +75,12 @@ namespace FidelityFX.OpticalFlow public ComputeShader prepareLuma; /// - /// The compute shader used by the generate SCD histogram pass. + /// The compute shader used by the generate scene change detection histogram pass. /// public ComputeShader generateScdHistogram; /// - /// The compute shader used by the compute SCD divergence pass. + /// The compute shader used by the compute scene change detection divergence pass. /// public ComputeShader computeScdDivergence; diff --git a/Runtime/OpticalFlow/OpticalFlowContext.cs b/Runtime/OpticalFlow/OpticalFlowContext.cs new file mode 100644 index 0000000..17229a1 --- /dev/null +++ b/Runtime/OpticalFlow/OpticalFlowContext.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine; +using UnityEngine.Rendering; + +namespace FidelityFX.OpticalFlow +{ + public class OpticalFlowContext + { + private bool _firstExecution = true; + private uint _resourceFrameIndex; + + public void Dispatch(CommandBuffer commandBuffer, in OpticalFlow.DispatchDescription dispatchDescription) + { + throw new NotImplementedException(); + } + } +} diff --git a/Runtime/OpticalFlow/OpticalFlowContext.cs.meta b/Runtime/OpticalFlow/OpticalFlowContext.cs.meta new file mode 100644 index 0000000..22fa656 --- /dev/null +++ b/Runtime/OpticalFlow/OpticalFlowContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: baebcaebda3cbd344a546d7f3c47ae0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: