1- ; RUN: %dxv %s | FileCheck %s
1+ ; REQUIRES: dxil-1-9
2+ ; RUN: %dxv %s 2>&1 | FileCheck %s
23
34; CHECK: Validation succeeded.
45
@@ -15,20 +16,12 @@ target triple = "dxil-ms-dx"
1516
1617; Function Attrs: nounwind
1718define void @"\01 ?main@@YAXXZ" () #0 {
18- %payload = alloca %struct.Payload , align 4
19- %rtas = load %dx.types.Handle , %dx.types.Handle* @"\01 ?RTAS@@3URaytracingAccelerationStructure@@A" , align 4
20-
21- ; Setup acceleration structure handle
22- %handle = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle (i32 160 , %dx.types.Handle %rtas ) ; CreateHandleForLib(Resource)
23- %annotatedHandle = call %dx.types.Handle @dx.op.annotateHandle (i32 216 , %dx.types.Handle %handle , %dx.types.ResourceProperties { i32 16 , i32 0 }) ; AnnotateHandle(res,props) resource: RTAccelerationStructure
24-
25- ; Test HitObject_TraceRay (opcode 262)
26- %r262 = call %dx.types.HitObject @dx.op.hitObject_TraceRay.struct.Payload (i32 262 , %dx.types.Handle %annotatedHandle , i32 513 , i32 1 , i32 2 , i32 4 , i32 0 , float 0 .000000e+00 , float 1 .000000e+00 , float 2 .000000e+00 , float 3 .000000e+00 , float 4 .000000e+00 , float 5 .000000e+00 , float 6 .000000e+00 , float 7 .000000e+00 , %struct.Payload* nonnull %payload ) ; HitObject_TraceRay(accelerationStructure,rayFlags,instanceInclusionMask,rayContributionToHitGroupIndex,multiplierForGeometryContributionToHitGroupIndex,missShaderIndex,Origin_X,Origin_Y,Origin_Z,TMin,Direction_X,Direction_Y,Direction_Z,TMax,payload)
27-
28- ; Test HitObject_Invoke (opcode 267)
29- %nop = call %dx.types.HitObject @dx.op.hitObject_MakeNop (i32 266 ) ; HitObject_MakeNop()
30- call void @dx.op.hitObject_Invoke.struct.Payload (i32 267 , %dx.types.HitObject %r262 , %struct.Payload* nonnull %payload ) ; HitObject_Invoke(hitObject,payload)
31-
19+ %1 = load %dx.types.Handle , %dx.types.Handle* @"\01 ?RTAS@@3URaytracingAccelerationStructure@@A" , align 4
20+ %2 = alloca %struct.Payload , align 4
21+ %3 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle (i32 160 , %dx.types.Handle %1 ) ; CreateHandleForLib(Resource)
22+ %4 = call %dx.types.Handle @dx.op.annotateHandle (i32 216 , %dx.types.Handle %3 , %dx.types.ResourceProperties { i32 16 , i32 0 }) ; AnnotateHandle(res,props) resource: RTAccelerationStructure
23+ %5 = call %dx.types.HitObject @dx.op.hitObject_TraceRay.struct.Payload (i32 262 , %dx.types.Handle %4 , i32 513 , i32 1 , i32 2 , i32 4 , i32 0 , float 0 .000000e+00 , float 1 .000000e+00 , float 2 .000000e+00 , float 3 .000000e+00 , float 4 .000000e+00 , float 5 .000000e+00 , float 6 .000000e+00 , float 7 .000000e+00 , %struct.Payload* nonnull %2 ) ; HitObject_TraceRay(accelerationStructure,rayFlags,instanceInclusionMask,rayContributionToHitGroupIndex,multiplierForGeometryContributionToHitGroupIndex,missShaderIndex,Origin_X,Origin_Y,Origin_Z,TMin,Direction_X,Direction_Y,Direction_Z,TMax,payload)
24+ call void @dx.op.hitObject_Invoke.struct.Payload (i32 267 , %dx.types.HitObject %5 , %struct.Payload* nonnull %2 ) ; HitObject_Invoke(hitObject,payload)
3225 ret void
3326}
3427
@@ -38,9 +31,6 @@ declare %dx.types.HitObject @dx.op.hitObject_TraceRay.struct.Payload(i32, %dx.ty
3831; Function Attrs: nounwind
3932declare void @dx.op.hitObject_Invoke.struct.Payload (i32 , %dx.types.HitObject , %struct.Payload* ) #0
4033
41- ; Function Attrs: nounwind readnone
42- declare %dx.types.HitObject @dx.op.hitObject_MakeNop (i32 ) #1
43-
4434; Function Attrs: nounwind readnone
4535declare %dx.types.Handle @dx.op.annotateHandle (i32 , %dx.types.Handle , %dx.types.ResourceProperties ) #1
4636
@@ -51,24 +41,28 @@ attributes #0 = { nounwind }
5141attributes #1 = { nounwind readnone }
5242attributes #2 = { nounwind readonly }
5343
54- !0 = !{i32 1 , i32 9 }
55- !1 = !{!"lib" , i32 6 , i32 9 }
56- !2 = !{!3 , null , null , null }
57- !3 = !{!4 }
58- !4 = !{i32 0 , %struct.RaytracingAccelerationStructure* bitcast (%dx.types.Handle* @"\01 ?RTAS@@3URaytracingAccelerationStructure@@A" to %struct.RaytracingAccelerationStructure* ), !"RTAS" , i32 -1 , i32 -1 , i32 1 , i32 16 , i32 0 , !5 }
59- !5 = !{i32 0 , i32 4 }
60- !6 = !{i32 1 , void ()* @"\01 ?main@@YAXXZ" , !7 }
61- !7 = !{!8 }
62- !8 = !{i32 1 , !5 , !5 }
63- !9 = !{null , !"" , null , !2 , !10 }
64- !10 = !{i32 0 , i64 33554432 }
65- !11 = !{void ()* @"\01 ?main@@YAXXZ" , !"\01 ?main@@YAXXZ" , null , null , !12 }
66- !12 = !{i32 8 , i32 7 , i32 5 , !13 }
67- !13 = !{i32 0 }
68-
6944!dx.version = !{!0 }
7045!dx.valver = !{!0 }
7146!dx.shaderModel = !{!1 }
7247!dx.resources = !{!2 }
73- !dx.typeAnnotations = !{!6 }
74- !dx.entryPoints = !{!9 , !11 }
48+ !dx.typeAnnotations = !{!3 }
49+ !dx.dxrPayloadAnnotations = !{!4 }
50+ !dx.entryPoints = !{!5 , !6 }
51+
52+ !0 = !{i32 1 , i32 9 }
53+ !1 = !{!"lib" , i32 6 , i32 9 }
54+ !2 = !{!7 , null , null , null }
55+ !3 = !{i32 1 , void ()* @"\01 ?main@@YAXXZ" , !8 }
56+ !4 = !{i32 0 , %struct.Payload undef , !9 }
57+ !5 = !{null , !"" , null , !2 , null }
58+ !6 = !{void ()* @"\01 ?main@@YAXXZ" , !"\01 ?main@@YAXXZ" , null , null , !10 }
59+ !7 = !{!11 }
60+ !8 = !{!12 }
61+ !9 = !{!13 }
62+ !10 = !{i32 8 , i32 7 , i32 5 , !14 }
63+ !11 = !{i32 0 , %struct.RaytracingAccelerationStructure* bitcast (%dx.types.Handle* @"\01 ?RTAS@@3URaytracingAccelerationStructure@@A" to %struct.RaytracingAccelerationStructure* ), !"RTAS" , i32 -1 , i32 -1 , i32 1 , i32 16 , i32 0 , !15 }
64+ !12 = !{i32 1 , !16 , !16 }
65+ !13 = !{i32 0 , i32 8210 }
66+ !14 = !{i32 0 }
67+ !15 = !{i32 0 , i32 4 }
68+ !16 = !{}
0 commit comments