|
6 | 6 | // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -ast-dump \
|
7 | 7 | // RUN: -fdx-rootsignature-version=rootsig_1_1 \
|
8 | 8 | // RUN: -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-V1_1
|
| 9 | +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -ast-dump \ |
| 10 | +// RUN: -fdx-rootsignature-version=rootsig_1_2 \ |
| 11 | +// RUN: -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-V1_2 |
9 | 12 |
|
10 | 13 | // This test ensures that the sample root signature is parsed without error and
|
11 | 14 | // the Attr AST Node is created succesfully. If an invalid root signature was
|
|
31 | 34 | // CHECK: -HLSLRootSignatureDecl 0x{{.*}} {{.*}} implicit [[SAMPLE_RS_DECL:__hlsl_rootsig_decl_\d*]]
|
32 | 35 | // CHECK-V1_0: version: 1.0,
|
33 | 36 | // CHECK-V1_1: version: 1.1,
|
| 37 | +// CHECK-V1_2: version: 1.2, |
34 | 38 | // CHECK-SAME: RootElements{
|
35 | 39 | // CHECK-SAME: RootFlags(AllowInputAssemblerInputLayout | DenyVertexShaderRootAccess),
|
36 | 40 | // CHECK-SAME: RootCBV(b0,
|
|
62 | 66 | // CHECK-SAME: s0, numDescriptors = 4, space = 1, offset = DescriptorTableOffsetAppend,
|
63 | 67 | // CHECK-V1_0-SAME: flags = DescriptorsVolatile
|
64 | 68 | // CHECK-V1_1-SAME: flags = None
|
| 69 | +// CHECK-V1_2-SAME: flags = None |
65 | 70 | // CHECK-SAME: ),
|
66 | 71 | // CHECK-SAME: DescriptorTable(
|
67 | 72 | // CHECK-SAME: numClauses = 1, visibility = All
|
|
73 | 78 | // CHECK-SAME: s1, filter = Anisotropic, addressU = Wrap, addressV = Wrap, addressW = Wrap,
|
74 | 79 | // CHECK-SAME: mipLODBias = 0.000000e+00, maxAnisotropy = 16, comparisonFunc = LessEqual,
|
75 | 80 | // CHECK-SAME: borderColor = OpaqueWhite, minLOD = 0.000000e+00, maxLOD = 3.402823e+38, space = 0, visibility = All
|
| 81 | +// CHECK-SAME: flags = None |
76 | 82 | // CHECK-SAME: )}
|
77 | 83 |
|
78 | 84 | // CHECK: -RootSignatureAttr 0x{{.*}} {{.*}} [[SAMPLE_RS_DECL]]
|
@@ -131,3 +137,24 @@ void same_rs_string_main() {}
|
131 | 137 | // CHECK: -RootSignatureAttr 0x{{.*}} {{.*}} [[DIFF_RS_DECL]]
|
132 | 138 | [RootSignature(SampleDifferentRS)]
|
133 | 139 | void different_rs_string_main() {}
|
| 140 | + |
| 141 | +#define SampleStaticSamplerRS \ |
| 142 | + "StaticSampler(s0, flags = NON_NORMALIZED_COORDINATES)" |
| 143 | + |
| 144 | +// Ensure that static samplers flags are correctly parsed in different versions |
| 145 | + |
| 146 | +// CHECK: -HLSLRootSignatureDecl 0x{{.*}} {{.*}} implicit [[DIFF_RS_DECL:__hlsl_rootsig_decl_\d*]] |
| 147 | +// CHECK-V1_0: version: 1.0, |
| 148 | +// CHECK-V1_1: version: 1.1, |
| 149 | +// CHECK-V1_2: version: 1.2, |
| 150 | +// CHECK-SAME: RootElements{ |
| 151 | +// CHECK-SAME: StaticSampler( |
| 152 | +// CHECK-SAME: s0, filter = Anisotropic, addressU = Wrap, addressV = Wrap, addressW = Wrap, |
| 153 | +// CHECK-SAME: mipLODBias = 0.000000e+00, maxAnisotropy = 16, comparisonFunc = LessEqual, |
| 154 | +// CHECK-SAME: borderColor = OpaqueWhite, minLOD = 0.000000e+00, maxLOD = 3.402823e+38, space = 0, visibility = All |
| 155 | +// CHECK-SAME: flags = NonNormalizedCoordinates |
| 156 | +// CHECK-SAME: )} |
| 157 | + |
| 158 | +// CHECK: -RootSignatureAttr 0x{{.*}} {{.*}} [[DIFF_RS_DECL]] |
| 159 | +[RootSignature(SampleStaticSamplerRS)] |
| 160 | +void statoc_sampler_v12_main() {} |
0 commit comments