Skip to content

Commit 05fb2d9

Browse files
committed
[ser] Added UAV-overload Barrier REORDER_SCOPE test
1 parent ada5df7 commit 05fb2d9

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

tools/clang/test/DXILValidation/ser_reorder_scope_sm69_passing.ll

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,71 @@
22

33
; CHECK: Validation succeeded.
44

5+
6+
; shader hash: 55f96d488362429d3301238ab9ac07fd
7+
;
8+
; Buffer Definitions:
9+
;
10+
;
11+
; Resource Bindings:
12+
;
13+
; Name Type Format Dim ID HLSL Bind Count
14+
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
15+
; BAB UAV byte r/w U0 u1 1
16+
;
517
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
618
target triple = "dxil-ms-dx"
719

20+
%dx.types.Handle = type { i8* }
21+
%dx.types.ResourceProperties = type { i32, i32 }
22+
%struct.RWByteAddressBuffer = type { i32 }
23+
24+
@"\01?BAB@@3URWByteAddressBuffer@@A" = external constant %dx.types.Handle, align 4
25+
826
; Function Attrs: nounwind
927
define void @"\01?main@@YAXXZ"() #0 {
28+
%1 = load %dx.types.Handle, %dx.types.Handle* @"\01?BAB@@3URWByteAddressBuffer@@A", align 4
1029
call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8) ; BarrierByMemoryType(MemoryTypeFlags,SemanticFlags)
30+
%2 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1) ; CreateHandleForLib(Resource)
31+
%3 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer
32+
call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %3, i32 8) ; BarrierByMemoryHandle(object,SemanticFlags)
1133
ret void
1234
}
1335

1436
; Function Attrs: noduplicate nounwind
1537
declare void @dx.op.barrierByMemoryType(i32, i32, i32) #1
1638

39+
; Function Attrs: noduplicate nounwind
40+
declare void @dx.op.barrierByMemoryHandle(i32, %dx.types.Handle, i32) #1
41+
42+
; Function Attrs: nounwind readnone
43+
declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #2
44+
45+
; Function Attrs: nounwind readonly
46+
declare %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32, %dx.types.Handle) #3
47+
1748
attributes #0 = { nounwind }
1849
attributes #1 = { noduplicate nounwind }
50+
attributes #2 = { nounwind readnone }
51+
attributes #3 = { nounwind readonly }
1952

2053
!dx.version = !{!0}
2154
!dx.valver = !{!0}
2255
!dx.shaderModel = !{!1}
23-
!dx.typeAnnotations = !{!2}
24-
!dx.entryPoints = !{!6, !7}
56+
!dx.resources = !{!2}
57+
!dx.typeAnnotations = !{!3}
58+
!dx.entryPoints = !{!4, !5}
2559

2660
!0 = !{i32 1, i32 9}
2761
!1 = !{!"lib", i32 6, i32 9}
28-
!2 = !{i32 1, void ()* @"\01?main@@YAXXZ", !3}
29-
!3 = !{!4}
30-
!4 = !{i32 1, !5, !5}
31-
!5 = !{}
32-
!6 = !{null, !"", null, null, null}
33-
!7 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !8}
34-
!8 = !{i32 8, i32 7, i32 5, !9}
35-
!9 = !{i32 0}
36-
62+
!2 = !{null, !6, null, null}
63+
!3 = !{i32 1, void ()* @"\01?main@@YAXXZ", !7}
64+
!4 = !{null, !"", null, !2, !8}
65+
!5 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !9}
66+
!6 = !{!10}
67+
!7 = !{!11}
68+
!8 = !{i32 0, i64 8589934608}
69+
!9 = !{i32 8, i32 7, i32 5, !12}
70+
!10 = !{i32 0, %struct.RWByteAddressBuffer* bitcast (%dx.types.Handle* @"\01?BAB@@3URWByteAddressBuffer@@A" to %struct.RWByteAddressBuffer*), !"BAB", i32 0, i32 1, i32 1, i32 11, i1 false, i1 false, i1 false, null}
71+
!11 = !{i32 1, !12, !12}
72+
!12 = !{i32 0}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// RUN: %dxc -T lib_6_9 -E main %s | FileCheck %s
22

3+
RWByteAddressBuffer BAB : register(u1, space0);
4+
35
[shader("raygeneration")]
46
void main() {
57
// CHECK: call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8)
68
Barrier(UAV_MEMORY, REORDER_SCOPE);
9+
10+
// CHECK: call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %{{[^ ]+}}, i32 8)
11+
Barrier(BAB, REORDER_SCOPE);
712
}

0 commit comments

Comments
 (0)