Browse Source
Removed GLSL shader files as we don't actually use those, and to reduce clutter.
mac-autoexp
Removed GLSL shader files as we don't actually use those, and to reduce clutter.
mac-autoexp
22 changed files with 0 additions and 3227 deletions
-
1669Assets/Resources/FSR2/shaders/ffx_core_glsl.h
-
27Assets/Resources/FSR2/shaders/ffx_core_glsl.h.meta
-
87Assets/Resources/FSR2/shaders/ffx_fsr2_accumulate_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_accumulate_pass.glsl.meta
-
93Assets/Resources/FSR2/shaders/ffx_fsr2_autogen_reactive_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_autogen_reactive_pass.glsl.meta
-
681Assets/Resources/FSR2/shaders/ffx_fsr2_callbacks_glsl.h
-
27Assets/Resources/FSR2/shaders/ffx_fsr2_callbacks_glsl.h.meta
-
134Assets/Resources/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl.meta
-
67Assets/Resources/FSR2/shaders/ffx_fsr2_depth_clip_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_depth_clip_pass.glsl.meta
-
56Assets/Resources/FSR2/shaders/ffx_fsr2_lock_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_lock_pass.glsl.meta
-
62Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.glsl.meta
-
80Assets/Resources/FSR2/shaders/ffx_fsr2_rcas_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_rcas_pass.glsl.meta
-
65Assets/Resources/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl.meta
-
116Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.glsl
-
7Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.glsl.meta
1669
Assets/Resources/FSR2/shaders/ffx_core_glsl.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,27 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 8b1e08364d8608e4ea7f4372e5b2de67 |
|
||||
PluginImporter: |
|
||||
externalObjects: {} |
|
||||
serializedVersion: 2 |
|
||||
iconMap: {} |
|
||||
executionOrder: {} |
|
||||
defineConstraints: [] |
|
||||
isPreloaded: 0 |
|
||||
isOverridable: 0 |
|
||||
isExplicitlyReferenced: 0 |
|
||||
validateReferences: 1 |
|
||||
platformData: |
|
||||
- first: |
|
||||
Any: |
|
||||
second: |
|
||||
enabled: 1 |
|
||||
settings: {} |
|
||||
- first: |
|
||||
Editor: Editor |
|
||||
second: |
|
||||
enabled: 0 |
|
||||
settings: |
|
||||
DefaultValueInitialized: true |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,87 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 |
|
||||
// Needed for rw_upscaled_output declaration |
|
||||
#extension GL_EXT_shader_image_load_formatted : require |
|
||||
|
|
||||
#define FSR2_BIND_SRV_INPUT_EXPOSURE 0 |
|
||||
#define FSR2_BIND_SRV_DILATED_REACTIVE_MASKS 1 |
|
||||
#if FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS |
|
||||
#define FSR2_BIND_SRV_DILATED_MOTION_VECTORS 2 |
|
||||
#else |
|
||||
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 2 |
|
||||
#endif |
|
||||
#define FSR2_BIND_SRV_INTERNAL_UPSCALED 3 |
|
||||
#define FSR2_BIND_SRV_LOCK_STATUS 4 |
|
||||
#define FSR2_BIND_SRV_INPUT_DEPTH_CLIP 5 |
|
||||
#define FSR2_BIND_SRV_PREPARED_INPUT_COLOR 6 |
|
||||
#define FSR2_BIND_SRV_LUMA_INSTABILITY 7 |
|
||||
#define FSR2_BIND_SRV_LANCZOS_LUT 8 |
|
||||
#define FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT 9 |
|
||||
#define FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS 10 |
|
||||
#define FSR2_BIND_SRV_AUTO_EXPOSURE 11 |
|
||||
#define FSR2_BIND_SRV_LUMA_HISTORY 12 |
|
||||
|
|
||||
#define FSR2_BIND_UAV_INTERNAL_UPSCALED 13 |
|
||||
#define FSR2_BIND_UAV_LOCK_STATUS 14 |
|
||||
#define FSR2_BIND_UAV_UPSCALED_OUTPUT 15 |
|
||||
#define FSR2_BIND_UAV_NEW_LOCKS 16 |
|
||||
#define FSR2_BIND_UAV_LUMA_HISTORY 17 |
|
||||
|
|
||||
#define FSR2_BIND_CB_FSR2 18 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
#include "ffx_fsr2_sample.h" |
|
||||
#include "ffx_fsr2_upsample.h" |
|
||||
#include "ffx_fsr2_postprocess_lock_status.h" |
|
||||
#include "ffx_fsr2_reproject.h" |
|
||||
#include "ffx_fsr2_accumulate.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
|
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
uvec2 uGroupId = gl_WorkGroupID.xy; |
|
||||
const uint GroupRows = (uint(DisplaySize().y) + FFX_FSR2_THREAD_GROUP_HEIGHT - 1) / FFX_FSR2_THREAD_GROUP_HEIGHT; |
|
||||
uGroupId.y = GroupRows - uGroupId.y - 1; |
|
||||
|
|
||||
uvec2 uDispatchThreadId = uGroupId * uvec2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + gl_LocalInvocationID.xy; |
|
||||
|
|
||||
Accumulate(ivec2(uDispatchThreadId)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: a47992654ac46784d976db0091b79aeb |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,93 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_INPUT_OPAQUE_ONLY 0 |
|
||||
#define FSR2_BIND_SRV_INPUT_COLOR 1 |
|
||||
#define FSR2_BIND_UAV_AUTOREACTIVE 2 |
|
||||
#define FSR2_BIND_CB_REACTIVE 3 |
|
||||
#define FSR2_BIND_CB_FSR2 4 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
|
|
||||
// layout (set = 1, binding = FSR2_BIND_SRV_PRE_ALPHA_COLOR) uniform texture2D r_input_color_pre_alpha; |
|
||||
// layout (set = 1, binding = FSR2_BIND_SRV_POST_ALPHA_COLOR) uniform texture2D r_input_color_post_alpha; |
|
||||
// layout (set = 1, binding = FSR2_BIND_UAV_REACTIVE, r8) uniform image2D rw_output_reactive_mask; |
|
||||
|
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
#if defined(FSR2_BIND_CB_REACTIVE) |
|
||||
layout (set = 1, binding = FSR2_BIND_CB_REACTIVE, std140) uniform cbGenerateReactive_t |
|
||||
{ |
|
||||
float scale; |
|
||||
float threshold; |
|
||||
float binaryValue; |
|
||||
uint flags; |
|
||||
} cbGenerateReactive; |
|
||||
#endif |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
FfxUInt32x2 uDispatchThreadId = gl_GlobalInvocationID.xy; |
|
||||
|
|
||||
FfxFloat32x3 ColorPreAlpha = LoadOpaqueOnly(FFX_MIN16_I2(uDispatchThreadId)).rgb; |
|
||||
FfxFloat32x3 ColorPostAlpha = LoadInputColor(FFX_MIN16_I2(uDispatchThreadId)).rgb; |
|
||||
|
|
||||
if ((cbGenerateReactive.flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_TONEMAP) != 0) |
|
||||
{ |
|
||||
ColorPreAlpha = Tonemap(ColorPreAlpha); |
|
||||
ColorPostAlpha = Tonemap(ColorPostAlpha); |
|
||||
} |
|
||||
|
|
||||
if ((cbGenerateReactive.flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_INVERSETONEMAP) != 0) |
|
||||
{ |
|
||||
ColorPreAlpha = InverseTonemap(ColorPreAlpha); |
|
||||
ColorPostAlpha = InverseTonemap(ColorPostAlpha); |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 out_reactive_value = 0.f; |
|
||||
FfxFloat32x3 delta = abs(ColorPostAlpha - ColorPreAlpha); |
|
||||
|
|
||||
out_reactive_value = ((cbGenerateReactive.flags & FFX_FSR2_AUTOREACTIVEFLAGS_USE_COMPONENTS_MAX)!=0) ? max(delta.x, max(delta.y, delta.z)) : length(delta); |
|
||||
out_reactive_value *= cbGenerateReactive.scale; |
|
||||
|
|
||||
out_reactive_value = ((cbGenerateReactive.flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_THRESHOLD)!=0) ? ((out_reactive_value < cbGenerateReactive.threshold) ? 0 : cbGenerateReactive.binaryValue) : out_reactive_value; |
|
||||
|
|
||||
imageStore(rw_output_autoreactive, FfxInt32x2(uDispatchThreadId), vec4(out_reactive_value)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 9b3697948343bfb42ac4fbc18d2fb8be |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,681 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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. |
|
||||
#include "ffx_fsr2_resources.h" |
|
||||
|
|
||||
#if defined(FFX_GPU) |
|
||||
#include "ffx_core.h" |
|
||||
#endif // #if defined(FFX_GPU) |
|
||||
|
|
||||
#if defined(FFX_GPU) |
|
||||
#ifndef FFX_FSR2_PREFER_WAVE64 |
|
||||
#define FFX_FSR2_PREFER_WAVE64 |
|
||||
#endif // #if defined(FFX_GPU) |
|
||||
|
|
||||
#if defined(FSR2_BIND_CB_FSR2) |
|
||||
layout (set = 1, binding = FSR2_BIND_CB_FSR2, std140) uniform cbFSR2_t |
|
||||
{ |
|
||||
FfxInt32x2 iRenderSize; |
|
||||
FfxInt32x2 iMaxRenderSize; |
|
||||
FfxInt32x2 iDisplaySize; |
|
||||
FfxInt32x2 iInputColorResourceDimensions; |
|
||||
FfxInt32x2 iLumaMipDimensions; |
|
||||
FfxInt32 iLumaMipLevelToUse; |
|
||||
FfxInt32 iFrameIndex; |
|
||||
|
|
||||
FfxFloat32x4 fDeviceToViewDepth; |
|
||||
FfxFloat32x2 fJitter; |
|
||||
FfxFloat32x2 fMotionVectorScale; |
|
||||
FfxFloat32x2 fDownscaleFactor; |
|
||||
FfxFloat32x2 fMotionVectorJitterCancellation; |
|
||||
FfxFloat32 fPreExposure; |
|
||||
FfxFloat32 fPreviousFramePreExposure; |
|
||||
FfxFloat32 fTanHalfFOV; |
|
||||
FfxFloat32 fJitterSequenceLength; |
|
||||
FfxFloat32 fDeltaTime; |
|
||||
FfxFloat32 fDynamicResChangeFactor; |
|
||||
FfxFloat32 fViewSpaceToMetersFactor; |
|
||||
} cbFSR2; |
|
||||
#endif |
|
||||
|
|
||||
FfxInt32x2 RenderSize() |
|
||||
{ |
|
||||
return cbFSR2.iRenderSize; |
|
||||
} |
|
||||
|
|
||||
FfxInt32x2 MaxRenderSize() |
|
||||
{ |
|
||||
return cbFSR2.iMaxRenderSize; |
|
||||
} |
|
||||
|
|
||||
FfxInt32x2 DisplaySize() |
|
||||
{ |
|
||||
return cbFSR2.iDisplaySize; |
|
||||
} |
|
||||
|
|
||||
FfxInt32x2 InputColorResourceDimensions() |
|
||||
{ |
|
||||
return cbFSR2.iInputColorResourceDimensions; |
|
||||
} |
|
||||
|
|
||||
FfxInt32x2 LumaMipDimensions() |
|
||||
{ |
|
||||
return cbFSR2.iLumaMipDimensions; |
|
||||
} |
|
||||
|
|
||||
FfxInt32 LumaMipLevelToUse() |
|
||||
{ |
|
||||
return cbFSR2.iLumaMipLevelToUse; |
|
||||
} |
|
||||
|
|
||||
FfxInt32 FrameIndex() |
|
||||
{ |
|
||||
return cbFSR2.iFrameIndex; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x4 DeviceToViewSpaceTransformFactors() |
|
||||
{ |
|
||||
return cbFSR2.fDeviceToViewDepth; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x2 Jitter() |
|
||||
{ |
|
||||
return cbFSR2.fJitter; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x2 MotionVectorScale() |
|
||||
{ |
|
||||
return cbFSR2.fMotionVectorScale; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x2 DownscaleFactor() |
|
||||
{ |
|
||||
return cbFSR2.fDownscaleFactor; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x2 MotionVectorJitterCancellation() |
|
||||
{ |
|
||||
return cbFSR2.fMotionVectorJitterCancellation; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 PreExposure() |
|
||||
{ |
|
||||
return cbFSR2.fPreExposure; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 PreviousFramePreExposure() |
|
||||
{ |
|
||||
return cbFSR2.fPreviousFramePreExposure; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 TanHalfFoV() |
|
||||
{ |
|
||||
return cbFSR2.fTanHalfFOV; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 JitterSequenceLength() |
|
||||
{ |
|
||||
return cbFSR2.fJitterSequenceLength; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 DeltaTime() |
|
||||
{ |
|
||||
return cbFSR2.fDeltaTime; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 DynamicResChangeFactor() |
|
||||
{ |
|
||||
return cbFSR2.fDynamicResChangeFactor; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32 ViewSpaceToMetersFactor() |
|
||||
{ |
|
||||
return cbFSR2.fViewSpaceToMetersFactor; |
|
||||
} |
|
||||
|
|
||||
layout (set = 0, binding = 0) uniform sampler s_PointClamp; |
|
||||
layout (set = 0, binding = 1) uniform sampler s_LinearClamp; |
|
||||
|
|
||||
// SRVs |
|
||||
#if defined(FSR2_BIND_SRV_INPUT_OPAQUE_ONLY) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INPUT_OPAQUE_ONLY) uniform texture2D r_input_opaque_only; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_INPUT_COLOR) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INPUT_COLOR) uniform texture2D r_input_color_jittered; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_INPUT_MOTION_VECTORS) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INPUT_MOTION_VECTORS) uniform texture2D r_input_motion_vectors; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_INPUT_DEPTH) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INPUT_DEPTH) uniform texture2D r_input_depth; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_INPUT_EXPOSURE) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INPUT_EXPOSURE) uniform texture2D r_input_exposure; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_AUTO_EXPOSURE) |
|
||||
layout(set = 1, binding = FSR2_BIND_SRV_AUTO_EXPOSURE) uniform texture2D r_auto_exposure; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_REACTIVE_MASK) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_REACTIVE_MASK) uniform texture2D r_reactive_mask; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK) uniform texture2D r_transparency_and_composition_mask; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH) uniform utexture2D r_reconstructed_previous_nearest_depth; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_DILATED_MOTION_VECTORS) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_DILATED_MOTION_VECTORS) uniform texture2D r_dilated_motion_vectors; |
|
||||
#endif |
|
||||
#if defined (FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS) |
|
||||
layout(set = 1, binding = FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS) uniform texture2D r_previous_dilated_motion_vectors; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_DILATED_DEPTH) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_DILATED_DEPTH) uniform texture2D r_dilatedDepth; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_INTERNAL_UPSCALED) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_INTERNAL_UPSCALED) uniform texture2D r_internal_upscaled_color; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_LOCK_STATUS) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_LOCK_STATUS) uniform texture2D r_lock_status; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_LOCK_INPUT_LUMA) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_LOCK_INPUT_LUMA) uniform texture2D r_lock_input_luma; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_NEW_LOCKS) |
|
||||
layout(set = 1, binding = FSR2_BIND_SRV_NEW_LOCKS) uniform texture2D r_new_locks; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_PREPARED_INPUT_COLOR) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_PREPARED_INPUT_COLOR) uniform texture2D r_prepared_input_color; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_LUMA_HISTORY) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_LUMA_HISTORY) uniform texture2D r_luma_history; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_RCAS_INPUT) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_RCAS_INPUT) uniform texture2D r_rcas_input; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_LANCZOS_LUT) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_LANCZOS_LUT) uniform texture2D r_lanczos_lut; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) uniform texture2D r_imgMips; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT) uniform texture2D r_upsample_maximum_bias_lut; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) |
|
||||
layout (set = 1, binding = FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) uniform texture2D r_dilated_reactive_masks; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR) |
|
||||
layout(set = 1, binding = FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR) uniform texture2D r_input_prev_color_pre_alpha; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR) |
|
||||
layout(set = 1, binding = FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR) uniform texture2D r_input_prev_color_post_alpha; |
|
||||
#endif |
|
||||
|
|
||||
// UAV |
|
||||
#if defined FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH, r32ui) uniform uimage2D rw_reconstructed_previous_nearest_depth; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_DILATED_MOTION_VECTORS |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_DILATED_MOTION_VECTORS, rg16f) writeonly uniform image2D rw_dilated_motion_vectors; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_DILATED_DEPTH |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_DILATED_DEPTH, r16f) writeonly uniform image2D rw_dilatedDepth; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_INTERNAL_UPSCALED |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_INTERNAL_UPSCALED, rgba16f) writeonly uniform image2D rw_internal_upscaled_color; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_LOCK_STATUS |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_LOCK_STATUS, rg16f) uniform image2D rw_lock_status; |
|
||||
#endif |
|
||||
#if defined(FSR2_BIND_UAV_LOCK_INPUT_LUMA) |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_LOCK_INPUT_LUMA, r16f) writeonly uniform image2D rw_lock_input_luma; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_NEW_LOCKS |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_NEW_LOCKS, r8) uniform image2D rw_new_locks; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_PREPARED_INPUT_COLOR |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_PREPARED_INPUT_COLOR, rgba16) writeonly uniform image2D rw_prepared_input_color; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_LUMA_HISTORY |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_LUMA_HISTORY, rgba8) uniform image2D rw_luma_history; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_UPSCALED_OUTPUT |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_UPSCALED_OUTPUT /* app controlled format */) writeonly uniform image2D rw_upscaled_output; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE, r16f) coherent uniform image2D rw_img_mip_shading_change; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_EXPOSURE_MIP_5 |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_EXPOSURE_MIP_5, r16f) coherent uniform image2D rw_img_mip_5; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_DILATED_REACTIVE_MASKS |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_DILATED_REACTIVE_MASKS, rg8) writeonly uniform image2D rw_dilated_reactive_masks; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_EXPOSURE |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_EXPOSURE, rg32f) uniform image2D rw_exposure; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_AUTO_EXPOSURE |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_AUTO_EXPOSURE, rg32f) uniform image2D rw_auto_exposure; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC |
|
||||
layout (set = 1, binding = FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC, r32ui) coherent uniform uimage2D rw_spd_global_atomic; |
|
||||
#endif |
|
||||
|
|
||||
#if defined FSR2_BIND_UAV_AUTOREACTIVE |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_AUTOREACTIVE, r32f) uniform image2D rw_output_autoreactive; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_AUTOCOMPOSITION |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_AUTOCOMPOSITION, r32f) uniform image2D rw_output_autocomposition; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR, r11f_g11f_b10f) uniform image2D rw_output_prev_color_pre_alpha; |
|
||||
#endif |
|
||||
#if defined FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR |
|
||||
layout(set = 1, binding = FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR, r11f_g11f_b10f) uniform image2D rw_output_prev_color_post_alpha; |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) |
|
||||
FfxFloat32 LoadMipLuma(FfxInt32x2 iPxPos, FfxInt32 mipLevel) |
|
||||
{ |
|
||||
return texelFetch(r_imgMips, iPxPos, FfxInt32(mipLevel)).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) |
|
||||
FfxFloat32 SampleMipLuma(FfxFloat32x2 fUV, FfxInt32 mipLevel) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_imgMips, s_LinearClamp), fUV, FfxFloat32(mipLevel)).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_DEPTH) |
|
||||
FfxFloat32 LoadInputDepth(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_input_depth, iPxPos, 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_REACTIVE_MASK) |
|
||||
FfxFloat32 LoadReactiveMask(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_reactive_mask, FfxInt32x2(iPxPos), 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK) |
|
||||
FfxFloat32 LoadTransparencyAndCompositionMask(FfxUInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_transparency_and_composition_mask, FfxInt32x2(iPxPos), 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_COLOR) |
|
||||
FfxFloat32x3 LoadInputColor(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_input_color_jittered, iPxPos, 0).rgb; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_COLOR) |
|
||||
FfxFloat32x3 SampleInputColor(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_input_color_jittered, s_LinearClamp), fUV, 0.0f).rgb; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_PREPARED_INPUT_COLOR) |
|
||||
FfxFloat32x3 LoadPreparedInputColor(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_prepared_input_color, iPxPos, 0).xyz; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_MOTION_VECTORS) |
|
||||
FfxFloat32x2 LoadInputMotionVector(FfxInt32x2 iPxDilatedMotionVectorPos) |
|
||||
{ |
|
||||
FfxFloat32x2 fSrcMotionVector = texelFetch(r_input_motion_vectors, iPxDilatedMotionVectorPos, 0).xy; |
|
||||
|
|
||||
FfxFloat32x2 fUvMotionVector = fSrcMotionVector * MotionVectorScale(); |
|
||||
|
|
||||
#if FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS |
|
||||
fUvMotionVector -= MotionVectorJitterCancellation(); |
|
||||
#endif |
|
||||
|
|
||||
return fUvMotionVector; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INTERNAL_UPSCALED) |
|
||||
FfxFloat32x4 LoadHistory(FfxInt32x2 iPxHistory) |
|
||||
{ |
|
||||
return texelFetch(r_internal_upscaled_color, iPxHistory, 0); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_LUMA_HISTORY) |
|
||||
void StoreLumaHistory(FfxInt32x2 iPxPos, FfxFloat32x4 fLumaHistory) |
|
||||
{ |
|
||||
imageStore(rw_luma_history, FfxInt32x2(iPxPos), fLumaHistory); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_LUMA_HISTORY) |
|
||||
FfxFloat32x4 SampleLumaHistory(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_luma_history, s_LinearClamp), fUV, 0.0f); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_INTERNAL_UPSCALED) |
|
||||
void StoreReprojectedHistory(FfxInt32x2 iPxHistory, FfxFloat32x4 fHistory) |
|
||||
{ |
|
||||
imageStore(rw_internal_upscaled_color, iPxHistory, fHistory); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_INTERNAL_UPSCALED) |
|
||||
void StoreInternalColorAndWeight(FfxInt32x2 iPxPos, FfxFloat32x4 fColorAndWeight) |
|
||||
{ |
|
||||
imageStore(rw_internal_upscaled_color, FfxInt32x2(iPxPos), fColorAndWeight); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_UPSCALED_OUTPUT) |
|
||||
void StoreUpscaledOutput(FfxInt32x2 iPxPos, FfxFloat32x3 fColor) |
|
||||
{ |
|
||||
imageStore(rw_upscaled_output, FfxInt32x2(iPxPos), FfxFloat32x4(fColor, 1.f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_LOCK_STATUS) |
|
||||
FfxFloat32x2 LoadLockStatus(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
FfxFloat32x2 fLockStatus = texelFetch(r_lock_status, iPxPos, 0).rg; |
|
||||
|
|
||||
return fLockStatus; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_LOCK_STATUS) |
|
||||
void StoreLockStatus(FfxInt32x2 iPxPos, FfxFloat32x2 fLockstatus) |
|
||||
{ |
|
||||
imageStore(rw_lock_status, iPxPos, vec4(fLockstatus, 0.0f, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_LOCK_INPUT_LUMA) |
|
||||
FfxFloat32 LoadLockInputLuma(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_lock_input_luma, iPxPos, 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_LOCK_INPUT_LUMA) |
|
||||
void StoreLockInputLuma(FfxInt32x2 iPxPos, FfxFloat32 fLuma) |
|
||||
{ |
|
||||
imageStore(rw_lock_input_luma, iPxPos, vec4(fLuma, 0, 0, 0)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_NEW_LOCKS) |
|
||||
FfxFloat32 LoadNewLocks(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_new_locks, iPxPos, 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_NEW_LOCKS) |
|
||||
FfxFloat32 LoadRwNewLocks(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return imageLoad(rw_new_locks, iPxPos).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_NEW_LOCKS) |
|
||||
void StoreNewLocks(FfxInt32x2 iPxPos, FfxFloat32 newLock) |
|
||||
{ |
|
||||
imageStore(rw_new_locks, iPxPos, vec4(newLock, 0, 0, 0)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_PREPARED_INPUT_COLOR) |
|
||||
void StorePreparedInputColor(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x4 fTonemapped) |
|
||||
{ |
|
||||
imageStore(rw_prepared_input_color, iPxPos, fTonemapped); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_PREPARED_INPUT_COLOR) |
|
||||
FfxFloat32 SampleDepthClip(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_prepared_input_color, s_LinearClamp), fUV, 0.0f).w; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_LOCK_STATUS) |
|
||||
FfxFloat32x2 SampleLockStatus(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
FfxFloat32x2 fLockStatus = textureLod(sampler2D(r_lock_status, s_LinearClamp), fUV, 0.0f).rg; |
|
||||
return fLockStatus; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DEPTH) |
|
||||
FfxFloat32 LoadSceneDepth(FfxInt32x2 iPxInput) |
|
||||
{ |
|
||||
return texelFetch(r_input_depth, iPxInput, 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH) |
|
||||
FfxFloat32 LoadReconstructedPrevDepth(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return uintBitsToFloat(texelFetch(r_reconstructed_previous_nearest_depth, iPxPos, 0).r); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH) |
|
||||
void StoreReconstructedDepth(FfxInt32x2 iPxSample, FfxFloat32 fDepth) |
|
||||
{ |
|
||||
FfxUInt32 uDepth = floatBitsToUint(fDepth); |
|
||||
|
|
||||
#if FFX_FSR2_OPTION_INVERTED_DEPTH |
|
||||
imageAtomicMax(rw_reconstructed_previous_nearest_depth, iPxSample, uDepth); |
|
||||
#else |
|
||||
imageAtomicMin(rw_reconstructed_previous_nearest_depth, iPxSample, uDepth); // min for standard, max for inverted depth |
|
||||
#endif |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH) |
|
||||
void SetReconstructedDepth(FfxInt32x2 iPxSample, FfxUInt32 uValue) |
|
||||
{ |
|
||||
imageStore(rw_reconstructed_previous_nearest_depth, iPxSample, uvec4(uValue, 0, 0, 0)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_DILATED_DEPTH) |
|
||||
void StoreDilatedDepth(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32 fDepth) |
|
||||
{ |
|
||||
//FfxUInt32 uDepth = f32tof16(fDepth); |
|
||||
imageStore(rw_dilatedDepth, iPxPos, vec4(fDepth, 0.0f, 0.0f, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_DILATED_MOTION_VECTORS) |
|
||||
void StoreDilatedMotionVector(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x2 fMotionVector) |
|
||||
{ |
|
||||
imageStore(rw_dilated_motion_vectors, iPxPos, vec4(fMotionVector, 0.0f, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DILATED_MOTION_VECTORS) |
|
||||
FfxFloat32x2 LoadDilatedMotionVector(FfxInt32x2 iPxInput) |
|
||||
{ |
|
||||
return texelFetch(r_dilated_motion_vectors, iPxInput, 0).rg; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DILATED_MOTION_VECTORS) |
|
||||
FfxFloat32x2 SampleDilatedMotionVector(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_dilated_motion_vectors, s_LinearClamp), fUV, 0.0f).rg; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS) |
|
||||
FfxFloat32x2 LoadPreviousDilatedMotionVector(FfxInt32x2 iPxInput) |
|
||||
{ |
|
||||
return texelFetch(r_previous_dilated_motion_vectors, iPxInput, 0).rg; |
|
||||
} |
|
||||
|
|
||||
FfxFloat32x2 SamplePreviousDilatedMotionVector(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_previous_dilated_motion_vectors, s_LinearClamp), fUV, 0.0f).xy; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DILATED_DEPTH) |
|
||||
FfxFloat32 LoadDilatedDepth(FfxInt32x2 iPxInput) |
|
||||
{ |
|
||||
return texelFetch(r_dilatedDepth, iPxInput, 0).r; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_EXPOSURE) |
|
||||
FfxFloat32 Exposure() |
|
||||
{ |
|
||||
FfxFloat32 exposure = texelFetch(r_input_exposure, FfxInt32x2(0, 0), 0).x; |
|
||||
|
|
||||
if (exposure == 0.0f) { |
|
||||
exposure = 1.0f; |
|
||||
} |
|
||||
|
|
||||
return exposure; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_AUTO_EXPOSURE) |
|
||||
FfxFloat32 AutoExposure() |
|
||||
{ |
|
||||
FfxFloat32 exposure = texelFetch(r_auto_exposure, FfxInt32x2(0, 0), 0).x; |
|
||||
|
|
||||
if (exposure == 0.0f) { |
|
||||
exposure = 1.0f; |
|
||||
} |
|
||||
|
|
||||
return exposure; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
FfxFloat32 SampleLanczos2Weight(FfxFloat32 x) |
|
||||
{ |
|
||||
#if defined(FSR2_BIND_SRV_LANCZOS_LUT) |
|
||||
return textureLod(sampler2D(r_lanczos_lut, s_LinearClamp), FfxFloat32x2(x / 2.0f, 0.5f), 0.0f).x; |
|
||||
#else |
|
||||
return 0.f; |
|
||||
#endif |
|
||||
} |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT) |
|
||||
FfxFloat32 SampleUpsampleMaximumBias(FfxFloat32x2 uv) |
|
||||
{ |
|
||||
// Stored as a SNORM, so make sure to multiply by 2 to retrieve the actual expected range. |
|
||||
return FfxFloat32(2.0f) * FfxFloat32(textureLod(sampler2D(r_upsample_maximum_bias_lut, s_LinearClamp), abs(uv) * 2.0f, 0.0f).r); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) |
|
||||
FfxFloat32x2 SampleDilatedReactiveMasks(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_dilated_reactive_masks, s_LinearClamp), fUV, 0.0f).rg; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) |
|
||||
FfxFloat32x2 LoadDilatedReactiveMasks(FFX_PARAMETER_IN FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_dilated_reactive_masks, iPxPos, 0).rg; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_DILATED_REACTIVE_MASKS) |
|
||||
void StoreDilatedReactiveMasks(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x2 fDilatedReactiveMasks) |
|
||||
{ |
|
||||
imageStore(rw_dilated_reactive_masks, iPxPos, vec4(fDilatedReactiveMasks, 0.0f, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FFX_INTERNAL) |
|
||||
FfxFloat32x4 SampleDebug(FfxFloat32x2 fUV) |
|
||||
{ |
|
||||
return textureLod(sampler2D(r_debug_out, s_LinearClamp), fUV, 0.0f).rgba; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_INPUT_OPAQUE_ONLY) |
|
||||
FfxFloat32x3 LoadOpaqueOnly(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_input_opaque_only, iPxPos, 0).xyz; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR) |
|
||||
FfxFloat32x3 LoadPrevPreAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_input_prev_color_pre_alpha, iPxPos, 0).xyz; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR) |
|
||||
FfxFloat32x3 LoadPrevPostAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_input_prev_color_post_alpha, iPxPos, 0).xyz; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_AUTOREACTIVE) |
|
||||
#if defined(FSR2_BIND_UAV_AUTOCOMPOSITION) |
|
||||
void StoreAutoReactive(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F2 fReactive) |
|
||||
{ |
|
||||
imageStore(rw_output_autoreactive, iPxPos, vec4(FfxFloat32(fReactive.x), 0.0f, 0.0f, 0.0f)); |
|
||||
|
|
||||
imageStore(rw_output_autocomposition, iPxPos, vec4(FfxFloat32(fReactive.y), 0.0f, 0.0f, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR) |
|
||||
void StorePrevPreAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F3 color) |
|
||||
{ |
|
||||
imageStore(rw_output_prev_color_pre_alpha, iPxPos, vec4(color, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#if defined(FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR) |
|
||||
void StorePrevPostAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F3 color) |
|
||||
{ |
|
||||
imageStore(rw_output_prev_color_post_alpha, iPxPos, vec4(color, 0.0f)); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#endif // #if defined(FFX_GPU) |
|
||||
@ -1,27 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 5cb9ad224bca34e4fbc3acf33bd82fbe |
|
||||
PluginImporter: |
|
||||
externalObjects: {} |
|
||||
serializedVersion: 2 |
|
||||
iconMap: {} |
|
||||
executionOrder: {} |
|
||||
defineConstraints: [] |
|
||||
isPreloaded: 0 |
|
||||
isOverridable: 0 |
|
||||
isExplicitlyReferenced: 0 |
|
||||
validateReferences: 1 |
|
||||
platformData: |
|
||||
- first: |
|
||||
Any: |
|
||||
second: |
|
||||
enabled: 1 |
|
||||
settings: {} |
|
||||
- first: |
|
||||
Editor: Editor |
|
||||
second: |
|
||||
enabled: 0 |
|
||||
settings: |
|
||||
DefaultValueInitialized: true |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,134 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_INPUT_COLOR 0 |
|
||||
#define FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC 1 |
|
||||
#define FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE 2 |
|
||||
#define FSR2_BIND_UAV_EXPOSURE_MIP_5 3 |
|
||||
#define FSR2_BIND_UAV_AUTO_EXPOSURE 4 |
|
||||
#define FSR2_BIND_CB_FSR2 5 |
|
||||
#define FSR2_BIND_CB_SPD 6 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
|
|
||||
#if defined(FSR2_BIND_CB_SPD) |
|
||||
layout (set = 1, binding = FSR2_BIND_CB_SPD, std140) uniform cbSPD_t |
|
||||
{ |
|
||||
uint mips; |
|
||||
uint numWorkGroups; |
|
||||
uvec2 workGroupOffset; |
|
||||
uvec2 renderSize; |
|
||||
} cbSPD; |
|
||||
|
|
||||
uint MipCount() |
|
||||
{ |
|
||||
return cbSPD.mips; |
|
||||
} |
|
||||
|
|
||||
uint NumWorkGroups() |
|
||||
{ |
|
||||
return cbSPD.numWorkGroups; |
|
||||
} |
|
||||
|
|
||||
uvec2 WorkGroupOffset() |
|
||||
{ |
|
||||
return cbSPD.workGroupOffset; |
|
||||
} |
|
||||
|
|
||||
uvec2 SPD_RenderSize() |
|
||||
{ |
|
||||
return cbSPD.renderSize; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
vec2 SPD_LoadExposureBuffer() |
|
||||
{ |
|
||||
return imageLoad(rw_auto_exposure, ivec2(0,0)).xy; |
|
||||
} |
|
||||
|
|
||||
void SPD_SetExposureBuffer(vec2 value) |
|
||||
{ |
|
||||
imageStore(rw_auto_exposure, ivec2(0,0), vec4(value, 0.0f, 0.0f)); |
|
||||
} |
|
||||
|
|
||||
vec4 SPD_LoadMipmap5(ivec2 iPxPos) |
|
||||
{ |
|
||||
return vec4(imageLoad(rw_img_mip_5, iPxPos).x, 0.0f, 0.0f, 0.0f); |
|
||||
} |
|
||||
|
|
||||
void SPD_SetMipmap(ivec2 iPxPos, uint slice, float value) |
|
||||
{ |
|
||||
switch (slice) |
|
||||
{ |
|
||||
case FFX_FSR2_SHADING_CHANGE_MIP_LEVEL: |
|
||||
imageStore(rw_img_mip_shading_change, iPxPos, vec4(value, 0.0f, 0.0f, 0.0f)); |
|
||||
break; |
|
||||
case 5: |
|
||||
imageStore(rw_img_mip_5, iPxPos, vec4(value, 0.0f, 0.0f, 0.0f)); |
|
||||
break; |
|
||||
default: |
|
||||
|
|
||||
// avoid flattened side effect |
|
||||
#if defined(FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE) |
|
||||
imageStore(rw_img_mip_shading_change, iPxPos, vec4(imageLoad(rw_img_mip_shading_change, iPxPos).x, 0.0f, 0.0f, 0.0f)); |
|
||||
#elif defined(FSR2_BIND_UAV_EXPOSURE_MIP_5) |
|
||||
imageStore(rw_img_mip_5, iPxPos, vec4(imageLoad(rw_img_mip_5, iPxPos).x, 0.0f, 0.0f, 0.0f)); |
|
||||
#endif |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
void SPD_IncreaseAtomicCounter(inout uint spdCounter) |
|
||||
{ |
|
||||
spdCounter = imageAtomicAdd(rw_spd_global_atomic, ivec2(0,0), 1); |
|
||||
} |
|
||||
|
|
||||
void SPD_ResetAtomicCounter() |
|
||||
{ |
|
||||
imageStore(rw_spd_global_atomic, ivec2(0,0), uvec4(0)); |
|
||||
} |
|
||||
|
|
||||
#include "ffx_fsr2_compute_luminance_pyramid.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 256 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
ComputeAutoExposure(gl_WorkGroupID.xyz, gl_LocalInvocationIndex); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 43b69b4a78d09164aa834576507445c1 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,67 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0 |
|
||||
#define FSR2_BIND_SRV_DILATED_MOTION_VECTORS 1 |
|
||||
#define FSR2_BIND_SRV_DILATED_DEPTH 2 |
|
||||
#define FSR2_BIND_SRV_REACTIVE_MASK 3 |
|
||||
#define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 4 |
|
||||
#define FSR2_BIND_SRV_PREPARED_INPUT_COLOR 5 |
|
||||
#define FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS 6 |
|
||||
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 7 |
|
||||
#define FSR2_BIND_SRV_INPUT_COLOR 8 |
|
||||
#define FSR2_BIND_SRV_INPUT_DEPTH 9 |
|
||||
#define FSR2_BIND_SRV_INPUT_EXPOSURE 10 |
|
||||
|
|
||||
#define FSR2_BIND_UAV_DEPTH_CLIP 11 |
|
||||
#define FSR2_BIND_UAV_DILATED_REACTIVE_MASKS 12 |
|
||||
#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 13 |
|
||||
|
|
||||
#define FSR2_BIND_CB_FSR2 14 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
#include "ffx_fsr2_sample.h" |
|
||||
#include "ffx_fsr2_depth_clip.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
DepthClip(ivec2(gl_GlobalInvocationID.xy)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: b02126743783b1942a0777c5e9b7526a |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,56 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_LOCK_INPUT_LUMA 0 |
|
||||
#define FSR2_BIND_UAV_NEW_LOCKS 1 |
|
||||
#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 2 |
|
||||
#define FSR2_BIND_CB_FSR2 3 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
#include "ffx_fsr2_sample.h" |
|
||||
#include "ffx_fsr2_lock.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
uvec2 uDispatchThreadId = gl_WorkGroupID.xy * uvec2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + gl_LocalInvocationID.xy; |
|
||||
|
|
||||
ComputeLock(ivec2(uDispatchThreadId)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 5f63384878e8f1c428f5716f3b8e1065 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,62 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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. |
|
||||
// FSR2 pass 1 |
|
||||
// SRV 1 : m_HDR : r_input_color_jittered |
|
||||
// SRV 4 : FSR2_Exposure : r_exposure |
|
||||
// UAV 7 : FSR2_ReconstructedPrevNearestDepth : rw_reconstructed_previous_nearest_depth |
|
||||
// UAV 13 : FSR2_PreparedInputColor : rw_prepared_input_color |
|
||||
// UAV 14 : FSR2_LumaHistory : rw_luma_history |
|
||||
// CB 0 : cbFSR2 |
|
||||
|
|
||||
#version 450 |
|
||||
|
|
||||
#extension GL_GOOGLE_include_directive : require |
|
||||
#extension GL_EXT_samplerless_texture_functions : require |
|
||||
|
|
||||
#define FSR2_BIND_SRV_INPUT_COLOR 0 |
|
||||
#define FSR2_BIND_SRV_EXPOSURE 1 |
|
||||
#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 2 |
|
||||
#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 3 |
|
||||
#define FSR2_BIND_UAV_LUMA_HISTORY 4 |
|
||||
#define FSR2_BIND_CB_FSR2 5 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
#include "ffx_fsr2_prepare_input_color.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
PrepareInputColor(ivec2(gl_GlobalInvocationID.xy)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 130af27aabe0f3347bf8fcfea8d5de84 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,80 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 |
|
||||
// Needed for rw_upscaled_output declaration |
|
||||
#extension GL_EXT_shader_image_load_formatted : require |
|
||||
|
|
||||
#define FSR2_BIND_SRV_INPUT_EXPOSURE 0 |
|
||||
#define FSR2_BIND_SRV_RCAS_INPUT 1 |
|
||||
#define FSR2_BIND_UAV_UPSCALED_OUTPUT 2 |
|
||||
#define FSR2_BIND_CB_FSR2 3 |
|
||||
#define FSR2_BIND_CB_RCAS 4 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
|
|
||||
//Move to prototype shader! |
|
||||
#if defined(FSR2_BIND_CB_RCAS) |
|
||||
layout (set = 1, binding = FSR2_BIND_CB_RCAS, std140) uniform cbRCAS_t |
|
||||
{ |
|
||||
uvec4 rcasConfig; |
|
||||
} cbRCAS; |
|
||||
|
|
||||
uvec4 RCASConfig() |
|
||||
{ |
|
||||
return cbRCAS.rcasConfig; |
|
||||
} |
|
||||
#else |
|
||||
uvec4 RCASConfig() |
|
||||
{ |
|
||||
return uvec4(0); |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
vec4 LoadRCAS_Input(FfxInt32x2 iPxPos) |
|
||||
{ |
|
||||
return texelFetch(r_rcas_input, iPxPos, 0); |
|
||||
} |
|
||||
|
|
||||
#include "ffx_fsr2_rcas.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 64 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
RCAS(gl_LocalInvocationID.xyz, gl_WorkGroupID.xyz, gl_GlobalInvocationID.xyz); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 6e70536fee1272645bab8093b1c715e7 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,65 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_INPUT_MOTION_VECTORS 0 |
|
||||
#define FSR2_BIND_SRV_INPUT_DEPTH 1 |
|
||||
#define FSR2_BIND_SRV_INPUT_COLOR 2 |
|
||||
#define FSR2_BIND_SRV_INPUT_EXPOSURE 3 |
|
||||
#define FSR2_BIND_SRV_LUMA_HISTORY 4 |
|
||||
|
|
||||
#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 5 |
|
||||
#define FSR2_BIND_UAV_DILATED_MOTION_VECTORS 6 |
|
||||
#define FSR2_BIND_UAV_DILATED_DEPTH 7 |
|
||||
#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 8 |
|
||||
#define FSR2_BIND_UAV_LUMA_HISTORY 9 |
|
||||
#define FSR2_BIND_UAV_LUMA_INSTABILITY 10 |
|
||||
#define FSR2_BIND_UAV_LOCK_INPUT_LUMA 11 |
|
||||
|
|
||||
#define FSR2_BIND_CB_FSR2 12 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
#include "ffx_fsr2_sample.h" |
|
||||
#include "ffx_fsr2_reconstruct_dilated_velocity_and_previous_depth.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
ReconstructAndDilate(FFX_MIN16_I2(gl_GlobalInvocationID.xy)); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: e3f9c69c87e772f4387b1bd3363a8688 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
@ -1,116 +0,0 @@ |
|||||
// This file is part of the FidelityFX SDK. |
|
||||
// |
|
||||
// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. |
|
||||
// |
|
||||
// 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 FSR2_BIND_SRV_INPUT_OPAQUE_ONLY 0 |
|
||||
#define FSR2_BIND_SRV_INPUT_COLOR 1 |
|
||||
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 2 |
|
||||
#define FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR 3 |
|
||||
#define FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR 4 |
|
||||
#define FSR2_BIND_SRV_REACTIVE_MASK 5 |
|
||||
#define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 6 |
|
||||
|
|
||||
#define FSR2_BIND_UAV_AUTOREACTIVE 7 |
|
||||
#define FSR2_BIND_UAV_AUTOCOMPOSITION 8 |
|
||||
#define FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR 9 |
|
||||
#define FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR 10 |
|
||||
|
|
||||
#define FSR2_BIND_CB_FSR2 11 |
|
||||
#define FSR2_BIND_CB_REACTIVE 12 |
|
||||
|
|
||||
#include "ffx_fsr2_callbacks_glsl.h" |
|
||||
#include "ffx_fsr2_common.h" |
|
||||
|
|
||||
#ifdef FSR2_BIND_CB_REACTIVE |
|
||||
layout (set = 1, binding = FSR2_BIND_CB_REACTIVE, std140) uniform cbGenerateReactive_t |
|
||||
{ |
|
||||
float fTcThreshold; // 0.1 is a good starting value, lower will result in more TC pixels |
|
||||
float fTcScale; |
|
||||
float fReactiveScale; |
|
||||
float fReactiveMax; |
|
||||
} cbGenerateReactive; |
|
||||
|
|
||||
float getTcThreshold() |
|
||||
{ |
|
||||
return cbGenerateReactive.fTcThreshold; |
|
||||
} |
|
||||
|
|
||||
#else |
|
||||
float getTcThreshold() |
|
||||
{ |
|
||||
return 0.05f; |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
#include "ffx_fsr2_tcr_autogen.h" |
|
||||
|
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_WIDTH 8 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 |
|
||||
#endif // FFX_FSR2_THREAD_GROUP_HEIGHT |
|
||||
#ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#define FFX_FSR2_THREAD_GROUP_DEPTH 1 |
|
||||
#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH |
|
||||
#ifndef FFX_FSR2_NUM_THREADS |
|
||||
#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; |
|
||||
#endif // #ifndef FFX_FSR2_NUM_THREADS |
|
||||
|
|
||||
FFX_FSR2_NUM_THREADS |
|
||||
void main() |
|
||||
{ |
|
||||
FFX_MIN16_I2 uDispatchThreadId = FFX_MIN16_I2(gl_GlobalInvocationID.xy); |
|
||||
|
|
||||
// ToDo: take into account jitter (i.e. add delta of previous jitter and current jitter to previous UV |
|
||||
// fetch pre- and post-alpha color values |
|
||||
FFX_MIN16_F2 fUv = ( FFX_MIN16_F2(uDispatchThreadId) + FFX_MIN16_F2(0.5f, 0.5f) ) / FFX_MIN16_F2( RenderSize() ); |
|
||||
FFX_MIN16_F2 fPrevUV = fUv + FFX_MIN16_F2( LoadInputMotionVector(uDispatchThreadId) ); |
|
||||
FFX_MIN16_I2 iPrevIdx = FFX_MIN16_I2(fPrevUV * FFX_MIN16_F2(RenderSize()) - 0.5f); |
|
||||
|
|
||||
FFX_MIN16_F3 colorPreAlpha = FFX_MIN16_F3( LoadOpaqueOnly( uDispatchThreadId ) ); |
|
||||
FFX_MIN16_F3 colorPostAlpha = FFX_MIN16_F3( LoadInputColor( uDispatchThreadId ) ); |
|
||||
|
|
||||
FFX_MIN16_F2 outReactiveMask = FFX_MIN16_F2( 0.f, 0.f ); |
|
||||
|
|
||||
outReactiveMask.y = ComputeTransparencyAndComposition(uDispatchThreadId, iPrevIdx); |
|
||||
|
|
||||
if (outReactiveMask.y > 0.5f) |
|
||||
{ |
|
||||
outReactiveMask.x = ComputeReactive(uDispatchThreadId, iPrevIdx); |
|
||||
outReactiveMask.x *= FFX_MIN16_F(cbGenerateReactive.fReactiveScale); |
|
||||
outReactiveMask.x = outReactiveMask.x < cbGenerateReactive.fReactiveMax ? outReactiveMask.x : FFX_MIN16_F( cbGenerateReactive.fReactiveMax ); |
|
||||
} |
|
||||
|
|
||||
outReactiveMask.y *= FFX_MIN16_F(cbGenerateReactive.fTcScale); |
|
||||
|
|
||||
outReactiveMask.x = ffxMax(outReactiveMask.x, FFX_MIN16_F(LoadReactiveMask(uDispatchThreadId))); |
|
||||
outReactiveMask.y = ffxMax(outReactiveMask.y, FFX_MIN16_F(LoadTransparencyAndCompositionMask(uDispatchThreadId))); |
|
||||
|
|
||||
StoreAutoReactive(uDispatchThreadId, outReactiveMask); |
|
||||
|
|
||||
StorePrevPreAlpha(uDispatchThreadId, colorPreAlpha); |
|
||||
StorePrevPostAlpha(uDispatchThreadId, colorPostAlpha); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
fileFormatVersion: 2 |
|
||||
guid: 9fa6f2f6f5a17084da2790fb96ee4c03 |
|
||||
DefaultImporter: |
|
||||
externalObjects: {} |
|
||||
userData: |
|
||||
assetBundleName: |
|
||||
assetBundleVariant: |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue