Skip to content

Commit a2a00a9

Browse files
committed
add test
1 parent 0e80c63 commit a2a00a9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

clang/test/AST/HLSL/RootSignatures-AST.hlsl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -ast-dump \
2-
// RUN: -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-V1_2
2+
// RUN: -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-V1_1
33
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -ast-dump \
44
// RUN: -fdx-rootsignature-version=rootsig_1_0 \
55
// RUN: -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-V1_0
@@ -139,3 +139,23 @@ void same_rs_string_main() {}
139139
// CHECK: -RootSignatureAttr 0x{{.*}} {{.*}} [[DIFF_RS_DECL]]
140140
[RootSignature(SampleDifferentRS)]
141141
void different_rs_string_main() {}
142+
143+
#define SampleStaticSamplerRS \
144+
"StaticSampler(s0, flags = NON_NORMALIZED_COORDINATES)"
145+
146+
// Ensure that static samplers flags are correctly parsed in different versions
147+
148+
// CHECK: -HLSLRootSignatureDecl 0x{{.*}} {{.*}} implicit [[DIFF_RS_DECL:__hlsl_rootsig_decl_\d*]]
149+
// CHECK-V1_0: version: 1.0,
150+
// CHECK-V1_1: version: 1.1,
151+
// CHECK-SAME: RootElements{
152+
// CHECK-SAME: StaticSampler(
153+
// CHECK-SAME: s0, filter = Anisotropic, addressU = Wrap, addressV = Wrap, addressW = Wrap,
154+
// CHECK-SAME: mipLODBias = 0.000000e+00, maxAnisotropy = 16, comparisonFunc = LessEqual,
155+
// CHECK-SAME: borderColor = OpaqueWhite, minLOD = 0.000000e+00, maxLOD = 3.402823e+38, space = 0, visibility = All
156+
// CHECK-SAME: flags = NonNormalizedCoordinates
157+
// CHECK-SAME: )}
158+
159+
// CHECK: -RootSignatureAttr 0x{{.*}} {{.*}} [[DIFF_RS_DECL]]
160+
[RootSignature(SampleStaticSamplerRS)]
161+
void statoc_sampler_v12_main() {}

0 commit comments

Comments
 (0)