mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-20 00:29:57 -04:00
Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT 0
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_1 1
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_2 2
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_3 3
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_4 4
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_5 5
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT_LEVEL_6 6
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 7
|
||||
#define FFX_OPTICALFLOW_BIND_CB_SPD 8
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
#include "opticalflow/ffx_opticalflow_compute_luminance_pyramid.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 256
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
ComputeOpticalFlowInputPyramid(FfxInt32x2(gl_WorkGroupID.xy), FfxInt32(gl_LocalInvocationIndex));
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_WAVE 1
|
||||
#extension GL_KHR_shader_subgroup_basic : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_INPUT 0
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_PREVIOUS_INPUT 1
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW 2
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_OUTPUT 3
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 4
|
||||
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_BLOCK_SIZE
|
||||
#define FFX_OPTICALFLOW_BLOCK_SIZE 8
|
||||
#endif // #ifndef FFX_OPTICALFLOW_BLOCK_SIZE
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 64
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_compute_optical_flow_v5.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
ComputeOpticalFlowAdvanced(FfxInt32x2(gl_GlobalInvocationID.xy), FfxInt32x2(gl_LocalInvocationID.xy), FfxInt32x2(gl_WorkGroupID.xy), FfxInt32(gl_LocalInvocationIndex));
|
||||
}
|
||||
57
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_compute_scd_divergence_pass.glsl
vendored
Normal file
57
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_compute_scd_divergence_pass.glsl
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_HISTOGRAM 0
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_PREVIOUS_HISTOGRAM 1
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_TEMP 2
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_OUTPUT 3
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 4
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
#include "opticalflow/ffx_opticalflow_compute_scd_divergence.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 256
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
FfxInt32x2 iGroupSize = FfxInt32x2(FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT);
|
||||
ComputeSCDHistogramsDivergence(FfxInt32x3(gl_GlobalInvocationID.xyz), FfxInt32x2(gl_LocalInvocationID.xy), FfxInt32(gl_LocalInvocationIndex), FfxInt32x2(gl_WorkGroupID.xy), iGroupSize);
|
||||
}
|
||||
57
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_filter_optical_flow_pass_v5.glsl
vendored
Normal file
57
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_filter_optical_flow_pass_v5.glsl
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_PREVIOUS 0
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW 1
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 2
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 16
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 4
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_filter_optical_flow_v5.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
FilterOpticalFlow(FfxInt32x2(gl_GlobalInvocationID.xy), FfxInt32x2(gl_LocalInvocationID.xy), FfxInt32x2(gl_WorkGroupID.xy), FfxInt32(gl_LocalInvocationIndex));
|
||||
}
|
||||
55
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_generate_scd_histogram_pass.glsl
vendored
Normal file
55
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_generate_scd_histogram_pass.glsl
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_INPUT 0
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_HISTOGRAM 1
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 2
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
#include "opticalflow/ffx_opticalflow_generate_scd_histogram.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 32
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 8
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
FfxInt32x2 iGroupSize = FfxInt32x2(FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT);
|
||||
GenerateSceneChangeDetectionHistogram(FfxInt32x3(gl_GlobalInvocationID.xyz), FfxInt32x2(gl_LocalInvocationID.xy), FfxInt32(gl_LocalInvocationIndex), FfxInt32x2(gl_WorkGroupID.xy), iGroupSize);
|
||||
}
|
||||
55
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_prepare_luma_pass.glsl
vendored
Normal file
55
third_party/fidelityfx-sdk/shaders/opticalflow/ffx_opticalflow_prepare_luma_pass.glsl
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_INPUT_COLOR 0
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_INPUT 1
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 2
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 16
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 16
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 1
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_prepare_luma.h"
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
PrepareLuma(FfxInt32x2(gl_GlobalInvocationID.xy), FfxInt32(gl_LocalInvocationIndex));
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// This file is part of the FidelityFX SDK.
|
||||
//
|
||||
// Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#version 450
|
||||
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_INPUT 0
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW_PREVIOUS_INPUT 1
|
||||
#define FFX_OPTICALFLOW_BIND_SRV_OPTICAL_FLOW 2
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_NEXT_LEVEL 3
|
||||
#define FFX_OPTICALFLOW_BIND_UAV_OPTICAL_FLOW_SCD_OUTPUT 4
|
||||
|
||||
#define FFX_OPTICALFLOW_BIND_CB_COMMON 5
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_callbacks_glsl.h"
|
||||
#include "opticalflow/ffx_opticalflow_common.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_BLOCK_SIZE
|
||||
#define FFX_OPTICALFLOW_BLOCK_SIZE 8
|
||||
#endif // #ifndef FFX_OPTICALFLOW_BLOCK_SIZE
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_WIDTH 4
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_WIDTH
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT 4
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
#define FFX_OPTICALFLOW_THREAD_GROUP_DEPTH 4
|
||||
#endif // #ifndef FFX_OPTICALFLOW_THREAD_GROUP_DEPTH
|
||||
|
||||
#include "opticalflow/ffx_opticalflow_scale_optical_flow_advanced_v5.h"
|
||||
|
||||
#ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
#define FFX_OPTICALFLOW_NUM_THREADS layout (local_size_x = FFX_OPTICALFLOW_THREAD_GROUP_WIDTH, local_size_y = FFX_OPTICALFLOW_THREAD_GROUP_HEIGHT, local_size_z = FFX_OPTICALFLOW_THREAD_GROUP_DEPTH) in;
|
||||
#endif // #ifndef FFX_OPTICALFLOW_NUM_THREADS
|
||||
|
||||
FFX_OPTICALFLOW_NUM_THREADS
|
||||
void main()
|
||||
{
|
||||
ScaleOpticalFlowAdvanced(FfxInt32x3(gl_GlobalInvocationID.xyz), FfxInt32x3(gl_LocalInvocationID.xyz));
|
||||
}
|
||||
Reference in New Issue
Block a user