Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 30th, 2013  |  syntax: C  |  size: 0.50 KB  |  views: 150  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. __kernel void reconstruct(      __write_only image2d_t backbuffer,
  2.                                 __global float4* traceResult,
  3.                                 const int num,
  4.                                 const int w,
  5.                                 const int h)
  6. {
  7.         int idx = get_global_id(0);
  8.  
  9.         if(idx < num)
  10.         {
  11.                 int2 coord = (int2)(idx % w, idx / w);
  12.                 float4 barycentric = traceResult[idx];
  13.                 barycentric.z = 1.0 - barycentric.x - barycentric.y;
  14.                 barycentric.w = 1.0;
  15.                 write_imagef(backbuffer, coord, barycentric);
  16.         }
  17. }