|
| 1 | +#--- source.hlsl |
| 2 | +StructuredBuffer<half4> In : register(t0); |
| 3 | + |
| 4 | +RWStructuredBuffer<half4> Out : register(u1); |
| 5 | + |
| 6 | + |
| 7 | +[numthreads(1,1,1)] |
| 8 | +void main() { |
| 9 | + Out[0] = normalize(In[0]); |
| 10 | + Out[1] = half4(normalize(In[1].xyz), normalize(In[1].w)); |
| 11 | + Out[2] = half4(normalize(In[2].xy), normalize(In[2].zw)); |
| 12 | + Out[3] = normalize(half4(1, 2, -3, 4)); |
| 13 | +} |
| 14 | +//--- pipeline.yaml |
| 15 | + |
| 16 | +--- |
| 17 | +Shaders: |
| 18 | + - Stage: Compute |
| 19 | + Entry: main |
| 20 | + DispatchSize: [1, 1, 1] |
| 21 | +Buffers: |
| 22 | + - Name: In |
| 23 | + Format: Float16 |
| 24 | + Stride: 8 |
| 25 | + Data: [ 0x3c00, 0x4000, 0xc200, 0x4400, 0x0000, 0x44b3, 0xc840, 0x491a, 0x4500, 0x4a00, 0x4200, 0xc400 ] |
| 26 | + # 1, 2, -3, 4, 0, 4.7, -8.5, 10.2, 5, 12, 3, -4 |
| 27 | + - Name: Out |
| 28 | + Format: Float16 |
| 29 | + Stride: 8 |
| 30 | + ZeroInitSize: 32 |
| 31 | + - Name: ExpectedOut |
| 32 | + Format: Float16 |
| 33 | + Stride: 8 |
| 34 | + Data: [ 0x31d8, 0x35d8, 0xb862, 0x39d8, 0, 0x37be, 0xbb00, 0x3c00, 0x3627, 0x3b62, 0x38cd, 0xba66, 0x31d8, 0x35d8, 0xb862, 0x39d8 ] |
| 35 | + # 0.18257, 0.36515, -0.54772, 0.73030, 0, 0.48389, -0.87513, 1, 0.38462, 0.92308, 0.6, -0.8, 0.18257, 0.36515, -0.54772, 0.73030 |
| 36 | +Results: |
| 37 | + - Result: Test0 |
| 38 | + Rule: BufferFloatULP |
| 39 | + ULPT: 2 |
| 40 | + Actual: Out |
| 41 | + Expected: ExpectedOut |
| 42 | +DescriptorSets: |
| 43 | + - Resources: |
| 44 | + - Name: In |
| 45 | + Kind: StructuredBuffer |
| 46 | + DirectXBinding: |
| 47 | + Register: 0 |
| 48 | + Space: 0 |
| 49 | + VulkanBinding: |
| 50 | + Binding: 0 |
| 51 | + - Name: Out |
| 52 | + Kind: RWStructuredBuffer |
| 53 | + DirectXBinding: |
| 54 | + Register: 1 |
| 55 | + Space: 0 |
| 56 | + VulkanBinding: |
| 57 | + Binding: 1 |
| 58 | +#--- end |
| 59 | + |
| 60 | +# REQUIRES: Half |
| 61 | +# RUN: split-file %s %t |
| 62 | +# RUN: %dxc_target -enable-16bit-types -HV 202x -T cs_6_5 -Fo %t.o %t/source.hlsl |
| 63 | +# RUN: %offloader %t/pipeline.yaml %t.o |
0 commit comments