Debian Codegraph @

thirdparty/amd-fsr2/shaders/ffx_fsr2_depth_clip_pass.glsl

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_RECONSTRUCTED_PREV_NEAREST_DEPTH 0
28 #define FSR2_BIND_SRV_DILATED_MOTION_VECTORS 1
29 #define FSR2_BIND_SRV_DILATED_DEPTH 2
30 #define FSR2_BIND_SRV_REACTIVE_MASK 3
31 #define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 4
32 #define FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS 6
33 #define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 7
34 #define FSR2_BIND_SRV_INPUT_COLOR 8
35 #define FSR2_BIND_SRV_INPUT_DEPTH 9
36 #define FSR2_BIND_SRV_INPUT_EXPOSURE 10
37
38 #define FSR2_BIND_UAV_DEPTH_CLIP 11
39 #define FSR2_BIND_UAV_DILATED_REACTIVE_MASKS 12
40 #define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 13
41
42 #define FSR2_BIND_CB_FSR2 14
43
44 #include "ffx_fsr2_callbacks_glsl.h"
45 #include "ffx_fsr2_common.h"
46 #include "ffx_fsr2_sample.h"
47 #include "ffx_fsr2_depth_clip.h"
48
49 #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
50 #define FFX_FSR2_THREAD_GROUP_WIDTH 8
51 #endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
52 #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
53 #define FFX_FSR2_THREAD_GROUP_HEIGHT 8
54 #endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
55 #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
56 #define FFX_FSR2_THREAD_GROUP_DEPTH 1
57 #endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
58 #ifndef FFX_FSR2_NUM_THREADS
59 #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;
60 #endif // #ifndef FFX_FSR2_NUM_THREADS
61
62 FFX_FSR2_NUM_THREADS
63 void main()
64 {
65 DepthClip(ivec2(gl_GlobalInvocationID.xy));
66 }