Skip to content

Commit 915a188

Browse files
authored
[Vulkan] Add dx layout option to cbuffer tests (#470)
Add the -fvk-use-dx-layout option to the cbuffer test to the layout of the cbuffers in Vulkan match Directx. This allows most of the cbuffer tests to pass with DXC. Two tests fail because DXC generates invalid SPIR-V. An issued was opened, and they are now tagged with that issue.
1 parent cb5dad1 commit 915a188

File tree

10 files changed

+44
-29
lines changed

10 files changed

+44
-29
lines changed

test/Feature/CBuffer/arrays-16bit.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,23 @@ DescriptorSets:
7171
DirectXBinding:
7272
Register: 0
7373
Space: 0
74+
VulkanBinding:
75+
Binding: 0
7476
- Name: Out
7577
Kind: RWStructuredBuffer
7678
DirectXBinding:
7779
Register: 1
7880
Space: 0
81+
VulkanBinding:
82+
Binding: 1
7983
...
8084
#--- end
8185

8286
# REQUIRES: Half, Int16
83-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
84-
# UNSUPPORTED: Vulkan
8587

8688
# Bug https://github.com/llvm/llvm-project/issues/138996
8789
# XFAIL: Clang
8890

8991
# RUN: split-file %s %t
90-
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
92+
# RUN: %dxc_target -fvk-use-dx-layout -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
9193
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/CBuffer/arrays-64bit.test

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,24 @@ DescriptorSets:
8181
DirectXBinding:
8282
Register: 0
8383
Space: 0
84+
VulkanBinding:
85+
Binding: 0
8486
- Name: Out
8587
Kind: RWStructuredBuffer
8688
DirectXBinding:
8789
Register: 1
8890
Space: 0
91+
VulkanBinding:
92+
Binding: 1
8993
...
9094
#--- end
9195

92-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
93-
# UNSUPPORTED: Vulkan
94-
96+
# Bug: https://github.com/microsoft/DirectXShaderCompiler/issues/7819
97+
# XFAIL: Vulkan
9598
# Unimplemented https://github.com/llvm/llvm-project/issues/147352
9699
# XFAIL: Clang
97100

98101
# REQUIRES: Double, Int64
99102
# RUN: split-file %s %t
100-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
103+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
101104
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/CBuffer/arrays.test

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,23 @@ DescriptorSets:
8181
DirectXBinding:
8282
Register: 0
8383
Space: 0
84+
VulkanBinding:
85+
Binding: 0
8486
- Name: Out
8587
Kind: RWStructuredBuffer
8688
DirectXBinding:
8789
Register: 1
8890
Space: 0
91+
VulkanBinding:
92+
Binding: 1
8993
...
9094
#--- end
9195

92-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
93-
# UNSUPPORTED: Vulkan
94-
96+
# Bug: https://github.com/microsoft/DirectXShaderCompiler/issues/7819
97+
# XFAIL: Vulkan
9598
# Unimplemented https://github.com/llvm/llvm-project/issues/147352
9699
# XFAIL: Clang
97100

98101
# RUN: split-file %s %t
99-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
102+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
100103
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/CBuffer/scalars-16bit.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ DescriptorSets:
5959
# REQUIRES: Half, Int16
6060

6161
# RUN: split-file %s %t
62-
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
62+
# RUN: %dxc_target -fvk-use-dx-layout -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
6363
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
6464

6565
# CHECK: - Name: CBScalars

test/Feature/CBuffer/scalars-64bit.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DescriptorSets:
5757

5858
# REQUIRES: Double, Int64
5959
# RUN: split-file %s %t
60-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
60+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
6161
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
6262

6363
# CHECK: Name: CBScalars

test/Feature/CBuffer/scalars.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DescriptorSets:
5757
#--- end
5858

5959
# RUN: split-file %s %t
60-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
60+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
6161
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
6262

6363
# CHECK: - Name: CBScalars

test/Feature/CBuffer/structs.test

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,24 @@ DescriptorSets:
8686
DirectXBinding:
8787
Register: 0
8888
Space: 0
89+
VulkanBinding:
90+
Binding: 0
8991
- Name: Out
9092
Kind: RWStructuredBuffer
9193
DirectXBinding:
9294
Register: 1
9395
Space: 0
96+
VulkanBinding:
97+
Binding: 1
9498
...
9599
#--- end
96100

97-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
98-
# UNSUPPORTED: Vulkan
99-
100-
+# Clang trips on 2-element vectors in structs:
101-
+# Bug https://github.com/llvm/llvm-project/issues/123968
102-
+# XFAIL: Clang
101+
# Clang trips on 2-element vectors in structs:
102+
# Bug https://github.com/llvm/llvm-project/issues/123968
103+
# XFAIL: Clang
103104

104105
# RUN: split-file %s %t
105-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
106+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
106107
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
107108

108109
# CHECK: - Name: CBVectors

test/Feature/CBuffer/vectors-16bit.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ DescriptorSets:
6060
# REQUIRES: Half, Int16
6161

6262
# RUN: split-file %s %t
63-
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
63+
# RUN: %dxc_target -fvk-use-dx-layout -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
6464
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
6565

6666
# CHECK: - Name: CBVectors

test/Feature/CBuffer/vectors-64bit.test

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,29 @@ DescriptorSets:
5151
DirectXBinding:
5252
Register: 0
5353
Space: 0
54+
VulkanBinding:
55+
Binding: 0
5456
- Name: Out
5557
Kind: RWStructuredBuffer
5658
DirectXBinding:
5759
Register: 1
5860
Space: 0
61+
VulkanBinding:
62+
Binding: 1
5963
...
6064
#--- end
6165

6266
# REQUIRES: Double, Int64
63-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
64-
# UNSUPPORTED: Vulkan
67+
68+
# Bug: https://github.com/llvm/offload-test-suite/issues/471
69+
# XFAIL: Vulkan && Intel
6570

6671
# Clang trips on 3-element vectors in structs:
6772
# Bug https://github.com/llvm/llvm-project/issues/123968
6873
# XFAIL: Clang
6974

7075
# RUN: split-file %s %t
71-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
76+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
7277
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
7378

7479
# CHECK: - Name: CBVectors

test/Feature/CBuffer/vectors.test

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,24 @@ DescriptorSets:
5252
DirectXBinding:
5353
Register: 0
5454
Space: 0
55+
VulkanBinding:
56+
Binding: 0
5557
- Name: Out
5658
Kind: RWStructuredBuffer
5759
DirectXBinding:
5860
Register: 1
5961
Space: 0
62+
VulkanBinding:
63+
Binding: 1
6064
...
6165
#--- end
6266

63-
# DXC's vulkan support does not layout cbuffers compatibly with DXIL
64-
# UNSUPPORTED: Vulkan
65-
6667
# Clang trips on 3-element vectors in structs:
6768
# Bug https://github.com/llvm/llvm-project/issues/123968
6869
# XFAIL: Clang
6970

7071
# RUN: split-file %s %t
71-
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
72+
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
7273
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
7374

7475
# CHECK: - Name: CBVectors

0 commit comments

Comments
 (0)