Skip to content

Commit c340acf

Browse files
committed
[SER] REORDER_SCOPE check-fail validation tests
Show 'REODER_SCOPE' memory flag rejected pre DXIL 1.9. REORDER_SCOPE validation logic already implemented in microsoft#7263 SER implementation tracker: microsoft#7214
1 parent 1198c30 commit c340acf

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
; RUN: %dxilver 1.8 | %dxv %s
2+
3+
; Buffer Definitions:
4+
;
5+
;
6+
; Resource Bindings:
7+
;
8+
; Name Type Format Dim ID HLSL Bind Count
9+
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
10+
; BAB UAV byte r/w U0 u1 1
11+
;
12+
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"
13+
target triple = "dxil-ms-dx"
14+
15+
%dx.types.Handle = type { i8* }
16+
%dx.types.ResourceProperties = type { i32, i32 }
17+
%struct.RWByteAddressBuffer = type { i32 }
18+
19+
@"\01?BAB@@3URWByteAddressBuffer@@A" = external constant %dx.types.Handle, align 4
20+
21+
; CHECK: Function: ?main@@YAXXZ: error: Invalid semantic flags on DXIL operation 'BarrierByMemoryType'
22+
; CHECK-NEXT: note: at 'call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8)' in block '#0' of function '?main@@YAXXZ'.
23+
; CHECK-NEXT: Function: ?main@@YAXXZ: error: Invalid semantic flags on DXIL operation 'barrierByMemoryHandle'
24+
; CHECK-NEXT: note: at 'call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %3, i32 8)' in block '#0' of function '?main@@YAXXZ'.
25+
; CHECK-NEXT: Function: ?main@@YAXXZ: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details.
26+
; CHECK-NEXT: Function: ?main@@YAXXZ: error: Function uses features incompatible with the shader model.
27+
; CHECK-NEXT: Validation failed.
28+
29+
; Function Attrs: nounwind
30+
define void @"\01?main@@YAXXZ"() #0 {
31+
%1 = load %dx.types.Handle, %dx.types.Handle* @"\01?BAB@@3URWByteAddressBuffer@@A", align 4
32+
call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8) ; BarrierByMemoryType(MemoryTypeFlags,SemanticFlags)
33+
%2 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1) ; CreateHandleForLib(Resource)
34+
%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
35+
call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %3, i32 8) ; BarrierByMemoryHandle(object,SemanticFlags)
36+
ret void
37+
}
38+
39+
; Function Attrs: noduplicate nounwind
40+
declare void @dx.op.barrierByMemoryType(i32, i32, i32) #1
41+
42+
; Function Attrs: noduplicate nounwind
43+
declare void @dx.op.barrierByMemoryHandle(i32, %dx.types.Handle, i32) #1
44+
45+
; Function Attrs: nounwind readnone
46+
declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #2
47+
48+
; Function Attrs: nounwind readonly
49+
declare %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32, %dx.types.Handle) #3
50+
51+
attributes #0 = { nounwind }
52+
attributes #1 = { noduplicate nounwind }
53+
attributes #2 = { nounwind readnone }
54+
attributes #3 = { nounwind readonly }
55+
56+
!dx.version = !{!0}
57+
!dx.valver = !{!0}
58+
!dx.shaderModel = !{!1}
59+
!dx.resources = !{!2}
60+
!dx.typeAnnotations = !{!5}
61+
!dx.entryPoints = !{!9, !11}
62+
63+
!0 = !{i32 1, i32 8}
64+
!1 = !{!"lib", i32 6, i32 8}
65+
!2 = !{null, !3, null, null}
66+
!3 = !{!4}
67+
!4 = !{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}
68+
!5 = !{i32 1, void ()* @"\01?main@@YAXXZ", !6}
69+
!6 = !{!7}
70+
!7 = !{i32 1, !8, !8}
71+
!8 = !{}
72+
!9 = !{null, !"", null, !2, !10}
73+
!10 = !{i32 0, i64 8589934608}
74+
!11 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !12}
75+
!12 = !{i32 8, i32 7, i32 5, !13}
76+
!13 = !{i32 0}

0 commit comments

Comments
 (0)