Skip to content
0.2.0-dev Download ZIP
65 lines ·2.9 KB Raw
1// This file is part of the FidelityFX SDK.
2//
3// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20// THE SOFTWARE.
21
22//#version 450
23
24#extension GL_GOOGLE_include_directive : require
25#extension GL_EXT_samplerless_texture_functions : require
26
27#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 0
28#define FSR2_BIND_SRV_INPUT_DEPTH 1
29#define FSR2_BIND_SRV_INPUT_COLOR 2
30#define FSR2_BIND_SRV_INPUT_EXPOSURE 3
31#define FSR2_BIND_SRV_LUMA_HISTORY 4
32
33#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 5
34#define FSR2_BIND_UAV_DILATED_MOTION_VECTORS 6
35#define FSR2_BIND_UAV_DILATED_DEPTH 7
36#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 8
37#define FSR2_BIND_UAV_LUMA_HISTORY 9
38#define FSR2_BIND_UAV_LUMA_INSTABILITY 10
39#define FSR2_BIND_UAV_LOCK_INPUT_LUMA 11
40
41#define FSR2_BIND_CB_FSR2 12
42
43#include "ffx_fsr2_callbacks_glsl.h"
44#include "ffx_fsr2_common.h"
45#include "ffx_fsr2_sample.h"
46#include "ffx_fsr2_reconstruct_dilated_velocity_and_previous_depth.h"
47
48#ifndef FFX_FSR2_THREAD_GROUP_WIDTH
49#define FFX_FSR2_THREAD_GROUP_WIDTH 8
50#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
51#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
52#define FFX_FSR2_THREAD_GROUP_HEIGHT 8
53#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
54#ifndef FFX_FSR2_THREAD_GROUP_DEPTH
55#define FFX_FSR2_THREAD_GROUP_DEPTH 1
56#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
57#ifndef FFX_FSR2_NUM_THREADS
58#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;
59#endif // #ifndef FFX_FSR2_NUM_THREADS
60
61FFX_FSR2_NUM_THREADS
62void main()
63{
64 ReconstructAndDilate(FFX_MIN16_I2(gl_GlobalInvocationID.xy));
65}