summaryrefslogtreecommitdiff
path: root/kernels/image_from_buffer.cl
blob: f970c8571385462dacdf33376a61bad03af15198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
__kernel void image_from_buffer(__read_only image2d_t src, __write_only image2d_t dst)
{
  int2 coord;
  int4 color;
  coord.x = (int)get_global_id(0);
  coord.y = (int)get_global_id(1);

  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;

  color = read_imagei(src, sampler, coord);
  write_imagei(dst, coord, color);
}