Skip to content

Commit 5ee579d

Browse files
authored
Add LIT capabilibies for vulkan extensions (#361)
This adds the ability to conditionalize tests based on available vulkan extensions. Since a set of our tests depend on float_controls2 when compiled with Clang, this allows those tests to pass if run on a device with flaot_controls2 support. The one additional tweak in this PR is to adjust the dot.fp16 test to have a wider tolerance range. DXC constant evaluates at a higher accuracy than the hardware evaluates at and our test assumes constant folded computation for the expected value. An ULP of 30 is wide enough to handle both the fp16 "correct" value and the wider computed value with rounding errors compounded.
1 parent 398da90 commit 5ee579d

File tree

10 files changed

+20
-12
lines changed

10 files changed

+20
-12
lines changed

test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test

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

5353

5454
# https://github.com/llvm/llvm-project/issues/149561
55-
# XFAIL: Clang-Vulkan
55+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
5656

5757
# RUN: split-file %s %t
5858
# RUN: %dxc_target -HV 202x -T cs_6_5 -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/dot.32.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ DescriptorSets:
190190
#--- end
191191

192192
# https://github.com/llvm/llvm-project/issues/149561
193-
# XFAIL: Clang-Vulkan
193+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
194194

195195
# RUN: split-file %s %t
196196
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/dot.fp16.test

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Buffers:
4848
# [ 8.20125, 8.20125, 0.35125, 0.35125, 5.57625, 5.57625, -17.61125, -17.61125 ]
4949
Results:
5050
- Result: Test1
51-
Rule: BufferFloatEpsilon
52-
Epsilon: 0.008
51+
Rule: BufferFloatULP
52+
ULPT: 30
5353
Actual: Out
5454
Expected: ExpectedOut
5555
DescriptorSets:
@@ -77,10 +77,14 @@ DescriptorSets:
7777
Binding: 2
7878
#--- end
7979

80+
# DXC is producing a compile-time value at a significantly higher precision than
81+
# runtime computed values for case 3 (clang will likely do the same once it
82+
# learns to constant evaluate `dot`).
83+
8084
# https://github.com/llvm/llvm-project/issues/149561
81-
# XFAIL: Clang-Vulkan
85+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
8286

8387
# REQUIRES: Half
8488
# RUN: split-file %s %t
85-
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
89+
# RUN: %dxc_target -enable-16bit-types -HV 202x -Gis -T cs_6_5 -Fo %t.o %t/source.hlsl
8690
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/HLSLLib/dot.fp64.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DescriptorSets:
7575
#--- end
7676

7777
# https://github.com/llvm/llvm-project/issues/149561
78-
# XFAIL: Clang-Vulkan
78+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
7979

8080
# REQUIRES: Double
8181
# RUN: split-file %s %t

test/Feature/HLSLLib/fmod.16.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DescriptorSets:
7070
#--- end
7171

7272
# https://github.com/llvm/llvm-project/issues/149561
73-
# XFAIL: Clang-Vulkan
73+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
7474

7575
# REQUIRES: Half
7676
# RUN: split-file %s %t

test/Feature/HLSLLib/fmod.32.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ DescriptorSets:
6767
#--- end
6868

6969
# https://github.com/llvm/llvm-project/issues/149561
70-
# XFAIL: Clang-Vulkan
70+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
7171

7272
# RUN: split-file %s %t
7373
# RUN: %dxc_target -Gis -T cs_6_5 -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/rcp.16.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ DescriptorSets:
6363
#--- end
6464

6565
# https://github.com/llvm/llvm-project/issues/149561
66-
# XFAIL: Clang-Vulkan
66+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
6767

6868
# REQUIRES: Half
6969
# RUN: split-file %s %t

test/Feature/HLSLLib/rcp.32.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ DescriptorSets:
6161
#--- end
6262

6363
# https://github.com/llvm/llvm-project/issues/149561
64-
# XFAIL: Clang-Vulkan
64+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
6565

6666
# RUN: split-file %s %t
6767
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/rcp.64.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ DescriptorSets:
6161
#--- end
6262

6363
# https://github.com/llvm/llvm-project/issues/149561
64-
# XFAIL: Clang-Vulkan
64+
# XFAIL: Clang-Vulkan && !VK_KHR_shader_float_controls2
6565

6666
# REQUIRES: Double
6767
# RUN: split-file %s %t

test/lit.cfg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def setDeviceFeatures(config, device, compiler):
9999
if device["Features"].get("shaderInt64", False):
100100
config.available_features.add("Int64")
101101

102+
# Add supported extensions.
103+
for Extension in device["Extensions"]:
104+
config.available_features.add(Extension["ExtensionName"])
105+
102106

103107
if config.offloadtest_test_warp:
104108
tools.append(

0 commit comments

Comments
 (0)