|
| 1 | +; RUN: %dxv %s | FileCheck %s |
| 2 | + |
| 3 | +; CHECK: Validation succeeded. |
| 4 | + |
| 5 | +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" |
| 6 | +target triple = "dxil-ms-dx" |
| 7 | + |
| 8 | +%dx.types.Handle = type { i8* } |
| 9 | +%struct.CustomAttrs = type { float, float } |
| 10 | +%dx.types.ResourceProperties = type { i32, i32 } |
| 11 | +%dx.types.HitObject = type { i8* } |
| 12 | +%struct.RaytracingAccelerationStructure = type { i32 } |
| 13 | + |
| 14 | +@"\01?RTAS@@3URaytracingAccelerationStructure@@A" = external constant %dx.types.Handle, align 4 |
| 15 | + |
| 16 | +; Function Attrs: nounwind |
| 17 | +define void @"\01?main@@YAXXZ"() #0 { |
| 18 | + %attrs = alloca %struct.CustomAttrs, align 4 |
| 19 | + %1 = load %dx.types.Handle, %dx.types.Handle* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", align 4 |
| 20 | + %rayQuery = call i32 @dx.op.allocateRayQuery(i32 178, i32 5) ; AllocateRayQuery(constRayFlags) |
| 21 | + %handle = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1) ; CreateHandleForLib(Resource) |
| 22 | + %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 |
| 23 | + call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %rayQuery, %dx.types.Handle %annotatedHandle, i32 0, i32 255, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 9.999000e+03) ; RayQuery_TraceRayInline(rayQueryHandle,accelerationStructure,rayFlags,instanceInclusionMask,origin_X,origin_Y,origin_Z,tMin,direction_X,direction_Y,direction_Z,tMax) |
| 24 | + |
| 25 | + ; Test HitObject_FromRayQuery (opcode 263) |
| 26 | + %r263 = call %dx.types.HitObject @dx.op.hitObject_FromRayQuery(i32 263, i32 %rayQuery) ; HitObject_FromRayQuery(rayQueryHandle) |
| 27 | + |
| 28 | + ; Test HitObject_FromRayQueryWithAttrs (opcode 264) |
| 29 | + %r264 = call %dx.types.HitObject @dx.op.hitObject_FromRayQueryWithAttrs.struct.CustomAttrs(i32 264, i32 %rayQuery, i32 16, %struct.CustomAttrs* nonnull %attrs) ; HitObject_FromRayQueryWithAttrs(rayQueryHandle,HitKind,CommittedAttribs) |
| 30 | + |
| 31 | + ret void |
| 32 | +} |
| 33 | + |
| 34 | +; Function Attrs: nounwind |
| 35 | +declare i32 @dx.op.allocateRayQuery(i32, i32) #0 |
| 36 | + |
| 37 | +; Function Attrs: nounwind |
| 38 | +declare void @dx.op.rayQuery_TraceRayInline(i32, i32, %dx.types.Handle, i32, i32, float, float, float, float, float, float, float, float) #0 |
| 39 | + |
| 40 | +; Function Attrs: nounwind argmemonly |
| 41 | +declare %dx.types.HitObject @dx.op.hitObject_FromRayQuery(i32, i32) #1 |
| 42 | + |
| 43 | +; Function Attrs: nounwind argmemonly |
| 44 | +declare %dx.types.HitObject @dx.op.hitObject_FromRayQueryWithAttrs.struct.CustomAttrs(i32, i32, i32, %struct.CustomAttrs*) #1 |
| 45 | + |
| 46 | +; Function Attrs: nounwind readnone |
| 47 | +declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #2 |
| 48 | + |
| 49 | +; Function Attrs: nounwind readonly |
| 50 | +declare %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32, %dx.types.Handle) #3 |
| 51 | + |
| 52 | +attributes #0 = { nounwind } |
| 53 | +attributes #1 = { nounwind argmemonly } |
| 54 | +attributes #2 = { nounwind readnone } |
| 55 | +attributes #3 = { nounwind readonly } |
| 56 | + |
| 57 | +!dx.version = !{!0} |
| 58 | +!dx.valver = !{!0} |
| 59 | +!dx.shaderModel = !{!1} |
| 60 | +!dx.resources = !{!2} |
| 61 | +!dx.typeAnnotations = !{!3} |
| 62 | +!dx.entryPoints = !{!4, !5} |
| 63 | + |
| 64 | +!0 = !{i32 1, i32 9} |
| 65 | +!1 = !{!"lib", i32 6, i32 9} |
| 66 | +!2 = !{!6, null, null, null} |
| 67 | +!3 = !{i32 1, void ()* @"\01?main@@YAXXZ", !7} |
| 68 | +!4 = !{null, !"", null, !2, !8} |
| 69 | +!5 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !9} |
| 70 | +!6 = !{!7} |
| 71 | +!7 = !{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, !10} |
| 72 | +!8 = !{i32 0, i64 33554432} |
| 73 | +!9 = !{i32 8, i32 7, i32 5, !11} |
| 74 | +!10 = !{i32 0, i32 4} |
| 75 | +!11 = !{i32 0} |
0 commit comments