summaryrefslogtreecommitdiff
path: root/kernels/test_copy_image_3d.cl
blob: 103fb69f0cdf09526348030d4a892dd9903611ce (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
__kernel void
test_copy_image_3d(__read_only image3d_t src,
                   __write_only image3d_t dst,
                   sampler_t sampler,
                   __write_only image2d_t buf0,
                   __write_only image2d_t buf1,
                   __write_only image2d_t buf2,
                   __write_only image2d_t buf3)
{
  int4 coord;
  int2 coord2;
  float4 color;
  coord.x = (int)get_global_id(0);
  coord.y = (int)get_global_id(1);
  coord.z = (int)get_global_id(2);
  coord2.x = coord.x;
  coord2.y = coord.y;
  color = read_imagef(src, sampler, coord);
  write_imagef(dst, coord, color);
  if (coord.z == 0)
    write_imagef(buf0, coord2, color);
  else if (coord.z == 1)
    write_imagef(buf1, coord2, color);
  else if (coord.z == 2)
    write_imagef(buf2, coord2, color);
  else if (coord.z == 3)
    write_imagef(buf3, coord2, color);
}