|
| 1 | +#--- source.hlsl |
| 2 | +StructuredBuffer<half4> In0 : register(t0); |
| 3 | +StructuredBuffer<half4> In1 : register(t1); |
| 4 | + |
| 5 | +RWStructuredBuffer<half4> Out0 : register(u2); |
| 6 | + |
| 7 | +[numthreads(1,1,1)] |
| 8 | +void main() { |
| 9 | + Out0[0] = fmod(In0[0], In1[0]); |
| 10 | + Out0[1] = half4(fmod(In0[1].xyz, In1[1].xyz), fmod(In0[1].w, In1[1].w)); |
| 11 | + Out0[2] = half4(fmod(In0[2].xy, In1[2].xy), fmod(In0[2].zw, In1[2].zw)); |
| 12 | + Out0[3] = fmod(half4(10.5, -99.5, 5, 0.25), half4(1, -3, 0.25, 5)); |
| 13 | +} |
| 14 | +//--- pipeline.yaml |
| 15 | + |
| 16 | +--- |
| 17 | +Shaders: |
| 18 | + - Stage: Compute |
| 19 | + Entry: main |
| 20 | + DispatchSize: [1, 1, 1] |
| 21 | +Buffers: |
| 22 | + - Name: In0 |
| 23 | + Format: Float16 |
| 24 | + Stride: 8 |
| 25 | + Data: [0x4940, 0xd638, 0x4500, 0x3400, 0, 0x6056, 0x4940, 0xd638, 0x4500, 0x3400, 0, 0x6056] |
| 26 | + # 10.5, -99.5, 5, 0.25, 0, 555, 10.5, -99.5, 5, 0.25, 0, 555 |
| 27 | + - Name: In1 |
| 28 | + Format: Float16 |
| 29 | + Stride: 8 |
| 30 | + Data: [0x3c00, 0xc200, 0x3400, 0x4500, 0x4900, 0x4100, 0x3c00, 0xc200, 0x3400, 0x4500, 0x4900, 0x4100] |
| 31 | + # 1, -3, 0.25, 5, 10, 2.5, 1, -3, 0.25, 5, 10, 2.5 |
| 32 | + - Name: Out0 |
| 33 | + Format: Float16 |
| 34 | + Stride: 8 |
| 35 | + ZeroInitSize: 32 |
| 36 | + - Name: ExpectedOut0 |
| 37 | + Format: Float16 |
| 38 | + Stride: 8 |
| 39 | + Data: [ 0x3800, 0xB800, 0x0, 0x3400, 0x0, 0x0, 0x3800, 0xB800, 0x0, 0x3400, 0x0, 0x0, 0x3800, 0xB800, 0x0, 0x3400 ] |
| 40 | + # 0.5, -0.5, 0, 0.25, 0, 0, 0.5 -0.5, 0, 0.25, 0, 0, 0.5, -0.5, 0, 0.25 |
| 41 | +Results: |
| 42 | + - Result: Test0 |
| 43 | + Rule: BufferFloatEpsilon |
| 44 | + Epsilon: 0.04 |
| 45 | + Actual: Out0 |
| 46 | + Expected: ExpectedOut0 |
| 47 | +DescriptorSets: |
| 48 | + - Resources: |
| 49 | + - Name: In0 |
| 50 | + Kind: StructuredBuffer |
| 51 | + DirectXBinding: |
| 52 | + Register: 0 |
| 53 | + Space: 0 |
| 54 | + VulkanBinding: |
| 55 | + Binding: 0 |
| 56 | + - Name: In1 |
| 57 | + Kind: StructuredBuffer |
| 58 | + DirectXBinding: |
| 59 | + Register: 1 |
| 60 | + Space: 0 |
| 61 | + VulkanBinding: |
| 62 | + Binding: 1 |
| 63 | + - Name: Out0 |
| 64 | + Kind: RWStructuredBuffer |
| 65 | + DirectXBinding: |
| 66 | + Register: 2 |
| 67 | + Space: 0 |
| 68 | + VulkanBinding: |
| 69 | + Binding: 2 |
| 70 | +#--- end |
| 71 | + |
| 72 | +# https://github.com/llvm/llvm-project/issues/149561 |
| 73 | +# XFAIL: Clang-Vulkan |
| 74 | + |
| 75 | +# REQUIRES: Half |
| 76 | +# RUN: split-file %s %t |
| 77 | +# RUN: %dxc_target -Gis -HV 202x -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl |
| 78 | +# RUN: %offloader %t/pipeline.yaml %t.o |
0 commit comments