Advertisement
Guest User

Untitled

a guest
May 28th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. // the streamoutbuffer with the coords
  2. ByteAddressBuffer sobCoords;
  3. // the filtered indices
  4. StructuredBuffer<uint> sbIndex;
  5. int elementcount;
  6.  
  7. RWStructuredBuffer<uint> buffer : BACKBUFFER;
  8.  
  9. [numthreads(64, 1, 1)]
  10. void CS( uint3 i : SV_DispatchThreadID)
  11. {
  12.     if (i.x >=  asuint(elementcount)) { return;}
  13.    
  14.     uint idx = sbIndex[i.x];
  15.    
  16.     float x = asfloat(sobCoords.Load(idx * 24));
  17.     float y = asfloat(sobCoords.Load(idx * 24 + 4));
  18.     float z = asfloat(sobCoords.Load(idx * 24 + 8));
  19.     float w = asfloat(sobCoords.Load(idx * 24 + 12));
  20.  
  21.     /* some more code here that is irrelevant*/
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement