#version 450

#extension GL_ARB_gpu_shader_int64 : require

layout(local_size_x = 64) in;

layout(std430, binding = 0)
writeonly buffer dst_buffer_t {
  uint64_t dst_queries[];
};

layout(std430, binding = 1)
readonly buffer src_buffer_t {
  uint64_t src_queries[];
};

layout(push_constant)
uniform u_info_t {
  uint dst_index;
  uint src_index;
  uint query_count;
};

void main() {
  uint thread_id = gl_GlobalInvocationID.x;

  if (thread_id < query_count)
    dst_queries[dst_index + thread_id] = min(src_queries[src_index + thread_id], uint64_t(1u));
}
