diff --git a/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute b/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute new file mode 100644 index 0000000..72f083a --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_compute_luminance_pyramid_pass.hlsl" diff --git a/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute.meta b/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute.meta new file mode 100644 index 0000000..5a3712d --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_luminance_pyramid_pass.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4c831117e9d7db4f904bd81e05f9def +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute b/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute new file mode 100644 index 0000000..03f2b42 --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.hlsl" diff --git a/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute.meta b/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute.meta new file mode 100644 index 0000000..edc54f6 --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_optical_flow_advanced_pass_v5.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f480a6ee4cca98544a6f72d0a57caa36 +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute b/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute new file mode 100644 index 0000000..ed05042 --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_compute_scd_divergence_pass.hlsl" diff --git a/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute.meta b/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute.meta new file mode 100644 index 0000000..9b0c3bb --- /dev/null +++ b/Shaders/ffx_opticalflow_compute_scd_divergence_pass.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06c260b21c4db2c4c88629b23a249e32 +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute b/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute new file mode 100644 index 0000000..9957c08 --- /dev/null +++ b/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_filter_optical_flow_pass_v5.hlsl" diff --git a/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute.meta b/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute.meta new file mode 100644 index 0000000..b0d9b37 --- /dev/null +++ b/Shaders/ffx_opticalflow_filter_optical_flow_pass_v5.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 067af02200e7be2469c7f23a8711fe3c +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute b/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute new file mode 100644 index 0000000..4c024b9 --- /dev/null +++ b/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_generate_scd_histogram_pass.hlsl" diff --git a/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute.meta b/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute.meta new file mode 100644 index 0000000..9ca1c68 --- /dev/null +++ b/Shaders/ffx_opticalflow_generate_scd_histogram_pass.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f20d1907c158bfe4d85b2f18d497a09f +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_prepare_luma_pass.compute b/Shaders/ffx_opticalflow_prepare_luma_pass.compute new file mode 100644 index 0000000..7b79431 --- /dev/null +++ b/Shaders/ffx_opticalflow_prepare_luma_pass.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_prepare_luma_pass.hlsl" diff --git a/Shaders/ffx_opticalflow_prepare_luma_pass.compute.meta b/Shaders/ffx_opticalflow_prepare_luma_pass.compute.meta new file mode 100644 index 0000000..f552b19 --- /dev/null +++ b/Shaders/ffx_opticalflow_prepare_luma_pass.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b70bda1db8d2f74396241d4811241ed +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute b/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute new file mode 100644 index 0000000..28e7fdc --- /dev/null +++ b/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Nico de Poel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + +#pragma kernel CS + +#pragma use_dxc +#pragma require WaveBasic + +#include "ffx_fsr_unity_common.cginc" + +#include "shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.hlsl" diff --git a/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute.meta b/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute.meta new file mode 100644 index 0000000..e17278a --- /dev/null +++ b/Shaders/ffx_opticalflow_scale_optical_flow_advanced_pass_v5.compute.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f25c92e19c76fbb42a3d0d4b5e1316e6 +ComputeShaderImporter: + externalObjects: {} + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/shaders/opticalflow/ffx_opticalflow_callbacks_hlsl.h b/Shaders/shaders/opticalflow/ffx_opticalflow_callbacks_hlsl.h index bd1d484..3dadc7c 100644 --- a/Shaders/shaders/opticalflow/ffx_opticalflow_callbacks_hlsl.h +++ b/Shaders/shaders/opticalflow/ffx_opticalflow_callbacks_hlsl.h @@ -28,7 +28,7 @@ #pragma dxc diagnostic push #pragma dxc diagnostic ignored "-Wambig-lit-shift" #endif //__hlsl_dx_compiler -#include "ffx_core.h" +#include "../ffx_core.h" #ifdef __hlsl_dx_compiler #pragma dxc diagnostic pop #endif //__hlsl_dx_compiler @@ -44,7 +44,7 @@ #undef FFX_OPTICALFLOW_USE_MSAD4_INSTRUCTION #endif -#include "opticalflow/ffx_opticalflow_common.h" +#include "ffx_opticalflow_common.h" #ifndef FFX_PREFER_WAVE64 #define FFX_PREFER_WAVE64 diff --git a/Shaders/shaders/opticalflow/ffx_opticalflow_compute_luminance_pyramid.h b/Shaders/shaders/opticalflow/ffx_opticalflow_compute_luminance_pyramid.h index b83710c..a51f1ed 100644 --- a/Shaders/shaders/opticalflow/ffx_opticalflow_compute_luminance_pyramid.h +++ b/Shaders/shaders/opticalflow/ffx_opticalflow_compute_luminance_pyramid.h @@ -91,7 +91,7 @@ FfxFloat32x4 SpdReduce4(FfxFloat32x4 v0, FfxFloat32x4 v1, FfxFloat32x4 v2, FfxFl #endif // https://github.com/GPUOpen-Effects/FidelityFX-SPD/blob/master/docs/FidelityFX_SPD.pdf -#include "spd/ffx_spd.h" +#include "../spd/ffx_spd.h" void ComputeOpticalFlowInputPyramid(FfxInt32x2 iGroupId, FfxInt32 iLocalIndex) {