John Kessenich | 66011cb | 2018-03-06 16:12:04 -0700 | [diff] [blame] | 1 | struct Types
|
| 2 | {
|
| 3 | uint4 u;
|
| 4 | int4 i;
|
| 5 | float4 f;
|
| 6 | double4 d;
|
| 7 | };
|
| 8 |
|
| 9 | RWStructuredBuffer<Types> data;
|
| 10 |
|
| 11 | [numthreads(32, 16, 1)]
|
| 12 | void CSMain(uint3 dti : SV_DispatchThreadID)
|
| 13 | {
|
| 14 | data[dti.x].u = WavePrefixSum(data[dti.x].u);
|
| 15 | data[dti.x].u.x = WavePrefixSum(data[dti.x].u.x);
|
| 16 | data[dti.x].u.xy = WavePrefixSum(data[dti.x].u.xy);
|
| 17 | data[dti.x].u.xyz = WavePrefixSum(data[dti.x].u.xyz);
|
| 18 |
|
| 19 | data[dti.x].i = WavePrefixSum(data[dti.x].i);
|
| 20 | data[dti.x].i.x = WavePrefixSum(data[dti.x].i.x);
|
| 21 | data[dti.x].i.xy = WavePrefixSum(data[dti.x].i.xy);
|
| 22 | data[dti.x].i.xyz = WavePrefixSum(data[dti.x].i.xyz);
|
| 23 |
|
| 24 | data[dti.x].f = WavePrefixSum(data[dti.x].f);
|
| 25 | data[dti.x].f.x = WavePrefixSum(data[dti.x].f.x);
|
| 26 | data[dti.x].f.xy = WavePrefixSum(data[dti.x].f.xy);
|
| 27 | data[dti.x].f.xyz = WavePrefixSum(data[dti.x].f.xyz);
|
| 28 |
|
| 29 | data[dti.x].d = WavePrefixSum(data[dti.x].d);
|
| 30 | data[dti.x].d.x = WavePrefixSum(data[dti.x].d.x);
|
| 31 | data[dti.x].d.xy = WavePrefixSum(data[dti.x].d.xy);
|
| 32 | data[dti.x].d.xyz = WavePrefixSum(data[dti.x].d.xyz);
|
| 33 |
|
| 34 | data[dti.x].u = WavePrefixProduct(data[dti.x].u);
|
| 35 | data[dti.x].u.x = WavePrefixProduct(data[dti.x].u.x);
|
| 36 | data[dti.x].u.xy = WavePrefixProduct(data[dti.x].u.xy);
|
| 37 | data[dti.x].u.xyz = WavePrefixProduct(data[dti.x].u.xyz);
|
| 38 |
|
| 39 | data[dti.x].i = WavePrefixProduct(data[dti.x].i);
|
| 40 | data[dti.x].i.x = WavePrefixProduct(data[dti.x].i.x);
|
| 41 | data[dti.x].i.xy = WavePrefixProduct(data[dti.x].i.xy);
|
| 42 | data[dti.x].i.xyz = WavePrefixProduct(data[dti.x].i.xyz);
|
| 43 |
|
| 44 | data[dti.x].f = WavePrefixProduct(data[dti.x].f);
|
| 45 | data[dti.x].f.x = WavePrefixProduct(data[dti.x].f.x);
|
| 46 | data[dti.x].f.xy = WavePrefixProduct(data[dti.x].f.xy);
|
| 47 | data[dti.x].f.xyz = WavePrefixProduct(data[dti.x].f.xyz);
|
| 48 |
|
| 49 | data[dti.x].d = WavePrefixProduct(data[dti.x].d);
|
| 50 | data[dti.x].d.x = WavePrefixProduct(data[dti.x].d.x);
|
| 51 | data[dti.x].d.xy = WavePrefixProduct(data[dti.x].d.xy);
|
| 52 | data[dti.x].d.xyz = WavePrefixProduct(data[dti.x].d.xyz);
|
| 53 |
|
| 54 | data[dti.x].u.x = WavePrefixCountBits(data[dti.x].u.x == 0);
|
| 55 | }
|