|
| 1 | +; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s |
| 2 | +; REQUIRES: dxil-1-9 |
| 3 | + |
| 4 | +; |
| 5 | +; Buffer Definitions: |
| 6 | +; |
| 7 | +; |
| 8 | +; Resource Bindings: |
| 9 | +; |
| 10 | +; Name Type Format Dim ID HLSL Bind Count |
| 11 | +; ------------------------------ ---------- ------- ----------- ------- -------------- ------ |
| 12 | +; RTAS texture i32 ras T0t4294967295,space4294967295 1 |
| 13 | +; |
| 14 | +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" |
| 15 | +target triple = "dxil-ms-dx" |
| 16 | + |
| 17 | +%struct.RaytracingAccelerationStructure = type { i32 } |
| 18 | +%struct.CustomAttrs = type { float, float } |
| 19 | +%dx.types.HitObject = type { i8* } |
| 20 | +%dx.types.Handle = type { i8* } |
| 21 | +%dx.types.ResourceProperties = type { i32, i32 } |
| 22 | +%"class.RWStructuredBuffer<float>" = type { float } |
| 23 | +%struct.RayDesc = type { <3 x float>, float, <3 x float>, float } |
| 24 | +%"class.dx::HitObject" = type { i32 } |
| 25 | +%"class.RayQuery<5, 0>" = type { i32 } |
| 26 | + |
| 27 | +@"\01?RTAS@@3URaytracingAccelerationStructure@@A" = external global %struct.RaytracingAccelerationStructure, align 4 |
| 28 | + |
| 29 | +; CHECK: %[[ATTRA:[^ ]+]] = alloca %struct.CustomAttrs |
| 30 | +; CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQH:[^ ]+]], %dx.types.Handle %{{[^ ]+}}, 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) |
| 31 | +; CHECK: %{{[^ ]+}} = call %dx.types.HitObject @dx.op.hitObject_FromRayQuery(i32 263, i32 %[[RQH]]) |
| 32 | +; CHECK: %{{[^ ]+}} = call %dx.types.HitObject @dx.op.hitObject_FromRayQueryWithAttrs.struct.CustomAttrs(i32 264, i32 %[[RQH]], i32 16, %struct.CustomAttrs* %[[ATTRA]]) |
| 33 | + |
| 34 | +; Function Attrs: nounwind |
| 35 | +define void @"\01?main@@YAXXZ"() #0 { |
| 36 | +entry: |
| 37 | + %0 = alloca %struct.CustomAttrs |
| 38 | + %agg.tmp = alloca %dx.types.HitObject, align 4 |
| 39 | + %agg.tmp1 = alloca %dx.types.HitObject, align 4 |
| 40 | + %q2 = call i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32 4, i32 5, i32 0), !dbg !38 ; line:29 col:78 |
| 41 | + %1 = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !dbg !42 ; line:31 col:3 |
| 42 | + %2 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RaytracingAccelerationStructure)"(i32 0, %struct.RaytracingAccelerationStructure %1), !dbg !42 ; line:31 col:3 |
| 43 | + %3 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure)"(i32 14, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 16, i32 0 }, %struct.RaytracingAccelerationStructure zeroinitializer), !dbg !42 ; line:31 col:3 |
| 44 | + call void @"dx.hl.op..void (i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 325, i32 %q2, %dx.types.Handle %3, i32 0, i32 255, <3 x float> zeroinitializer, float 0.000000e+00, <3 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00>, float 9.999000e+03), !dbg !42 ; line:31 col:3 |
| 45 | + call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32)"(i32 363, %dx.types.HitObject* %agg.tmp, i32 %q2), !dbg !43 ; line:33 col:7 |
| 46 | + call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 359, %dx.types.HitObject* %agg.tmp) #0, !dbg !44 ; line:24 col:3 |
| 47 | + %.0 = getelementptr inbounds %struct.CustomAttrs, %struct.CustomAttrs* %0, i32 0, i32 0 |
| 48 | + store float 1.000000e+00, float* %.0 |
| 49 | + %.1 = getelementptr inbounds %struct.CustomAttrs, %struct.CustomAttrs* %0, i32 0, i32 1 |
| 50 | + store float 2.000000e+00, float* %.1, align 4 |
| 51 | + call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.CustomAttrs*)"(i32 363, %dx.types.HitObject* %agg.tmp1, i32 %q2, i32 16, %struct.CustomAttrs* %0), !dbg !47 ; line:36 col:7 |
| 52 | + call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 359, %dx.types.HitObject* %agg.tmp1) #0, !dbg !48 ; line:24 col:3 |
| 53 | + ret void, !dbg !49 ; line:37 col:1 |
| 54 | +} |
| 55 | + |
| 56 | +; Function Attrs: nounwind |
| 57 | +declare void @llvm.lifetime.start(i64, i8* nocapture) #0 |
| 58 | + |
| 59 | +; Function Attrs: nounwind |
| 60 | +declare void @llvm.lifetime.end(i64, i8* nocapture) #0 |
| 61 | + |
| 62 | +; Function Attrs: nounwind |
| 63 | +declare void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32, %dx.types.HitObject*) #0 |
| 64 | + |
| 65 | +; Function Attrs: nounwind readnone |
| 66 | +declare %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RaytracingAccelerationStructure)"(i32, %struct.RaytracingAccelerationStructure) #1 |
| 67 | + |
| 68 | +; Function Attrs: nounwind readnone |
| 69 | +declare %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure)"(i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure) #1 |
| 70 | + |
| 71 | +; Function Attrs: nounwind |
| 72 | +declare i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32, i32, i32) #0 |
| 73 | + |
| 74 | +; Function Attrs: nounwind |
| 75 | +declare void @"dx.hl.op..void (i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float)"(i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float) #0 |
| 76 | + |
| 77 | +; Function Attrs: nounwind |
| 78 | +declare void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.CustomAttrs*)"(i32, %dx.types.HitObject*, i32, i32, %struct.CustomAttrs*) #0 |
| 79 | + |
| 80 | +; Function Attrs: nounwind |
| 81 | +declare void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32)"(i32, %dx.types.HitObject*, i32) #0 |
| 82 | + |
| 83 | +attributes #0 = { nounwind } |
| 84 | +attributes #1 = { nounwind readnone } |
| 85 | + |
| 86 | +!llvm.module.flags = !{!0} |
| 87 | +!pauseresume = !{!1} |
| 88 | +!dx.version = !{!2} |
| 89 | +!dx.valver = !{!2} |
| 90 | +!dx.shaderModel = !{!3} |
| 91 | +!dx.typeAnnotations = !{!4, !26} |
| 92 | +!dx.entryPoints = !{!30} |
| 93 | +!dx.fnprops = !{!35} |
| 94 | +!dx.options = !{!36, !37} |
| 95 | + |
| 96 | +!0 = !{i32 2, !"Debug Info Version", i32 3} |
| 97 | +!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"} |
| 98 | +!2 = !{i32 1, i32 9} |
| 99 | +!3 = !{!"lib", i32 6, i32 9} |
| 100 | +!4 = !{i32 0, %"class.RWStructuredBuffer<float>" undef, !5, %struct.RayDesc undef, !10, %"class.dx::HitObject" undef, !15, %"class.RayQuery<5, 0>" undef, !17, %struct.CustomAttrs undef, !23} |
| 101 | +!5 = !{i32 4, !6, !7} |
| 102 | +!6 = !{i32 6, !"h", i32 3, i32 0, i32 7, i32 9} |
| 103 | +!7 = !{i32 0, !8} |
| 104 | +!8 = !{!9} |
| 105 | +!9 = !{i32 0, float undef} |
| 106 | +!10 = !{i32 32, !11, !12, !13, !14} |
| 107 | +!11 = !{i32 6, !"Origin", i32 3, i32 0, i32 7, i32 9, i32 13, i32 3} |
| 108 | +!12 = !{i32 6, !"TMin", i32 3, i32 12, i32 7, i32 9} |
| 109 | +!13 = !{i32 6, !"Direction", i32 3, i32 16, i32 7, i32 9, i32 13, i32 3} |
| 110 | +!14 = !{i32 6, !"TMax", i32 3, i32 28, i32 7, i32 9} |
| 111 | +!15 = !{i32 4, !16} |
| 112 | +!16 = !{i32 6, !"h", i32 3, i32 0, i32 7, i32 4} |
| 113 | +!17 = !{i32 4, !18, !19} |
| 114 | +!18 = !{i32 6, !"h", i32 3, i32 0, i32 7, i32 5} |
| 115 | +!19 = !{i32 0, !20} |
| 116 | +!20 = !{!21, !22} |
| 117 | +!21 = !{i32 1, i64 5} |
| 118 | +!22 = !{i32 1, i64 0} |
| 119 | +!23 = !{i32 8, !24, !25} |
| 120 | +!24 = !{i32 6, !"x", i32 3, i32 0, i32 7, i32 9} |
| 121 | +!25 = !{i32 6, !"y", i32 3, i32 4, i32 7, i32 9} |
| 122 | +!26 = !{i32 1, void ()* @"\01?main@@YAXXZ", !27} |
| 123 | +!27 = !{!28} |
| 124 | +!28 = !{i32 1, !29, !29} |
| 125 | +!29 = !{} |
| 126 | +!30 = !{null, !"", null, !31, null} |
| 127 | +!31 = !{!32, null, null, null} |
| 128 | +!32 = !{!33} |
| 129 | +!33 = !{i32 0, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !"RTAS", i32 -1, i32 -1, i32 1, i32 16, i32 0, !34} |
| 130 | +!34 = !{i32 0, i32 4} |
| 131 | +!35 = !{void ()* @"\01?main@@YAXXZ", i32 7} |
| 132 | +!36 = !{i32 -2147483584} |
| 133 | +!37 = !{i32 -1} |
| 134 | +!38 = !DILocation(line: 29, column: 78, scope: !39) |
| 135 | +!39 = !DISubprogram(name: "main", scope: !40, file: !40, line: 28, type: !41, isLocal: false, isDefinition: true, scopeLine: 28, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @"\01?main@@YAXXZ") |
| 136 | +!40 = !DIFile(filename: "tools/clang/test/CodeGenDXIL/hlsl/objects/HitObject/hitobject_fromrayquery.hlsl", directory: "") |
| 137 | +!41 = !DISubroutineType(types: !29) |
| 138 | +!42 = !DILocation(line: 31, column: 3, scope: !39) |
| 139 | +!43 = !DILocation(line: 33, column: 7, scope: !39) |
| 140 | +!44 = !DILocation(line: 24, column: 3, scope: !45, inlinedAt: !46) |
| 141 | +!45 = !DISubprogram(name: "Use", scope: !40, file: !40, line: 23, type: !41, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: false) |
| 142 | +!46 = distinct !DILocation(line: 33, column: 3, scope: !39) |
| 143 | +!47 = !DILocation(line: 36, column: 7, scope: !39) |
| 144 | +!48 = !DILocation(line: 24, column: 3, scope: !45, inlinedAt: !49) |
| 145 | +!49 = distinct !DILocation(line: 36, column: 3, scope: !39) |
| 146 | +!50 = !DILocation(line: 37, column: 1, scope: !39) |
0 commit comments