blob: 7407285e3fc85109d4d71a8c619c4c94ca6530e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#version 450
layout(
local_size_x = 8,
local_size_y = 8,
local_size_z = 1) in;
layout(binding = 0) writeonly uniform uimageBuffer u_dst;
layout(binding = 1) uniform usamplerBuffer u_src;
layout(push_constant)
uniform u_info_t {
uvec3 dst_offset;
uvec3 src_offset;
uvec3 extent;
uvec2 dst_size;
uvec2 src_size;
} u_info;
void main() {
if (all(lessThan(gl_GlobalInvocationID, u_info.extent))) {
uvec3 dst_coord = u_info.dst_offset + gl_GlobalInvocationID;
uvec3 src_coord = u_info.src_offset + gl_GlobalInvocationID;
uint dst_index = dst_coord.x + u_info.dst_size.x * (dst_coord.y + u_info.dst_size.y * dst_coord.z);
uint src_index = src_coord.x + u_info.src_size.x * (src_coord.y + u_info.src_size.y * src_coord.z);
imageStore(u_dst, int(dst_index), texelFetch(u_src, int(src_index)));
}
}
|