Skip to content
0.2.0-dev Download ZIP
56 lines ·2.5 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_LOCK_INPUT_LUMA 0
28#define FSR2_BIND_UAV_NEW_LOCKS 1
29#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 2
30#define FSR2_BIND_CB_FSR2 3
31
32#include "ffx_fsr2_callbacks_glsl.h"
33#include "ffx_fsr2_common.h"
34#include "ffx_fsr2_sample.h"
35#include "ffx_fsr2_lock.h"
36
37#ifndef FFX_FSR2_THREAD_GROUP_WIDTH
38#define FFX_FSR2_THREAD_GROUP_WIDTH 8
39#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
40#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
41#define FFX_FSR2_THREAD_GROUP_HEIGHT 8
42#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
43#ifndef FFX_FSR2_THREAD_GROUP_DEPTH
44#define FFX_FSR2_THREAD_GROUP_DEPTH 1
45#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH
46#ifndef FFX_FSR2_NUM_THREADS
47#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;
48#endif // #ifndef FFX_FSR2_NUM_THREADS
49
50FFX_FSR2_NUM_THREADS
51void main()
52{
53 uvec2 uDispatchThreadId = gl_WorkGroupID.xy * uvec2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + gl_LocalInvocationID.xy;
54
55 ComputeLock(ivec2(uDispatchThreadId));
56}