Debian Codegraph @

thirdparty/amd-fsr2/shaders/ffx_fsr2_rcas_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 // Needed for rw_upscaled_output declaration
27 #extension GL_EXT_shader_image_load_formatted : require
28
29 #define FSR2_BIND_SRV_INPUT_EXPOSURE 0
30 #define FSR2_BIND_SRV_RCAS_INPUT 1
31 #define FSR2_BIND_UAV_UPSCALED_OUTPUT 2
32 #define FSR2_BIND_CB_FSR2 3
33 #define FSR2_BIND_CB_RCAS 4
34
35 #include "ffx_fsr2_callbacks_glsl.h"
36 #include "ffx_fsr2_common.h"
37
38 //Move to prototype shader!
39 #if defined(FSR2_BIND_CB_RCAS)
40 layout (set = 1, binding = FSR2_BIND_CB_RCAS, std140) uniform cbRCAS_t
41 {
42 uvec4 rcasConfig;
43 } cbRCAS;
44
45 uvec4 RCASConfig()
46 {
47 return cbRCAS.rcasConfig;
48 }
49 #else
50 uvec4 RCASConfig()
51 {
52 return uvec4(0);
53 }
54 #endif
55
56 vec4 LoadRCAS_Input(FfxInt32x2 iPxPos)
57 {
58 return texelFetch(r_rcas_input, iPxPos, 0);
59 }
60
61 #include "ffx_fsr2_rcas.h"
62
63 #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
64 #define FFX_FSR2_THREAD_GROUP_WIDTH 64
65 #endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
66 #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
67 #define FFX_FSR2_THREAD_GROUP_HEIGHT 1
68 #endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
69 #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
70 #define FFX_FSR2_THREAD_GROUP_DEPTH 1
71 #endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
72 #ifndef FFX_FSR2_NUM_THREADS
73 #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;
74 #endif // #ifndef FFX_FSR2_NUM_THREADS
75
76 FFX_FSR2_NUM_THREADS
77 void main()
78 {
79 RCAS(gl_LocalInvocationID.xyz, gl_WorkGroupID.xyz, gl_GlobalInvocationID.xyz);
80 }