summaryrefslogtreecommitdiff
path: root/opencl/svg-src-over.cl
blob: 13a1d19a066e00908519e2f145aa26f5f383d202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
__kernel void svg_src_over (__global const float4 *in,
                            __global const float4 *aux,
                            __global       float4 *out)
{
  int gid = get_global_id(0);
  float4 in_v  = in [gid];
  float4 aux_v = aux[gid];
  float4 out_v;
  out_v.xyz = aux_v.xyz + in_v.xyz * (1.0f - aux_v.w);
  out_v.w   = aux_v.w + in_v.w - aux_v.w * in_v.w;
  out[gid]  = out_v;
}