Skip to content

Commit a628688

Browse files
committed
[ser] Improve 'reordercoherent' tests
1 parent 788c541 commit a628688

7 files changed

Lines changed: 26 additions & 35 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %dxc -E main -T lib_6_9 %s | FileCheck %s
2+
// REQUIRES: dxil-1-9
3+
4+
// CHECK: %[[uH:[^ ]+]] = load %dx.types.Handle, %dx.types.Handle* @"\01?u@@3V?$RWBuffer@M@@A", align 4
5+
// CHECK: %[[uLIBH:[^ ]+]] = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %[[uH]]) ; CreateHandleForLib(Resource)
6+
// CHECK: %[[uANNOT:[^ ]+]] = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %[[uLIBH]], %dx.types.ResourceProperties { i32 69642, i32 265 }) ; AnnotateHandle(res,props) resource: RWTypedBuffer<F32>
7+
// CHECK: %{{[^ ]+}} = call %dx.types.ResRet.f32 @dx.op.bufferLoad.f32(i32 68, %dx.types.Handle %[[uANNOT]], i32 0, i32 undef) ; BufferLoad(srv,index,wot)
8+
9+
RWBuffer<float> OutBuf : register(u1);
10+
reordercoherent RWBuffer<float> u : register(u2);
11+
12+
float read(RWBuffer<float> buf) {
13+
return buf[0];
14+
}
15+
16+
[shader("raygeneration")]
17+
void main() {
18+
OutBuf[0] = read(u);
19+
}

tools/clang/test/HLSLFileCheck/hlsl/types/modifiers/reordercoherent/reordercoherent.hlsl renamed to tools/clang/test/CodeGenDXIL/hlsl/attributes/reordercoherent_uav.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %dxc -E main -T lib_6_9 %s | FileCheck %s
2+
// REQUIRES: dxil-1-9
23

34
// CHECK: !"uav1", {{.+}}, ![[TAGMD:[0-9]+]]}
45
// CHECK: ![[TAGMD]] = !{i32 0, i32 9, i32 4, i1 true

tools/clang/test/HLSLFileCheck/hlsl/types/modifiers/reordercoherent/reordercoherent3.hlsl renamed to tools/clang/test/CodeGenDXIL/hlsl/attributes/reordercoherent_uav_array.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %dxc -E main -T lib_6_9 %s | FileCheck %s
2+
// REQUIRES: dxil-1-9
23

34
// Make sure uav array can have reordercoherent.
45
// CHECK: !{{.*}} = !{i32 1, [12 x %"class.RWTexture2D<float>"]* bitcast ([12 x %dx.types.Handle]* @"\01?tex@@3PAV?$RWTexture2D@M@@A" to [12 x %"class.RWTexture2D<float>"]*), !"tex", i32 0, i32 2, i32 12, i32 2, i1 false, i1 false, i1 false, ![[TAGMD:.*]]}
@@ -10,6 +11,6 @@ reordercoherent RWTexture2D<float> tex[12] : register(u2);
1011

1112
[shader("raygeneration")]
1213
void main() {
13-
float2 c = 1.* DispatchRaysIndex().xy;
14+
int2 c = DispatchRaysIndex().xy;
1415
OutBuf[0] = tex[0][c];
1516
}

tools/clang/test/HLSLFileCheck/hlsl/types/modifiers/reordercoherent/reordercoherent2.hlsl

Lines changed: 0 additions & 17 deletions
This file was deleted.

tools/clang/test/HLSLFileCheck/hlsl/types/modifiers/reordercoherent/reordercoherent_for_arg.hlsl

Lines changed: 0 additions & 16 deletions
This file was deleted.

tools/clang/test/HLSLFileCheck/hlsl/types/modifiers/reordercoherent/reordercoherent_ast.hlsl renamed to tools/clang/test/SemaHLSL/attributes/reordercoherent_ast.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %dxc -T lib_6_9 -ast-dump %s | FileCheck %s
2+
// REQUIRES: dxil-1-9
23

34
// CHECK: |-VarDecl {{.*}} used uav1 'reordercoherent RWTexture1D<float4>':'RWTexture1D<vector<float, 4> >'
45
// CHECK-NEXT: | |-HLSLReorderCoherentAttr

tools/clang/test/SemaHLSL/reordercoherent-globallycoherent-mismatch.hlsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
RWByteAddressBuffer NonCBuf;
44
globallycoherent RWByteAddressBuffer GCBuf;
55
reordercoherent RWByteAddressBuffer RCBuf;
6-
reordercoherent globallycoherent RWByteAddressBuffer RCGCBuf; // expected-warning{{Attribute 'reordercoherent' implied by 'globallycoherent' in 'RCGCBuf'. 'reordercoherent' ignored.}}
6+
// expected-warning@+2{{attribute 'globallycoherent' implies 'reordercoherent'}}
7+
// expected-warning@+1{{Attribute 'reordercoherent' implied by 'globallycoherent' in 'RCGCBuf'. 'reordercoherent' ignored.}}
8+
reordercoherent globallycoherent RWByteAddressBuffer RCGCBuf;
79

810
globallycoherent RWByteAddressBuffer getPromoteRC() {
911
return RCBuf; // expected-warning{{implicit conversion from 'reordercoherent RWByteAddressBuffer' to 'globallycoherent RWByteAddressBuffer' promotes reordercoherent to globallycoherent annotation}}

0 commit comments

Comments
 (0)