Skip to content

Commit f79d0ca

Browse files
committed
[SER] DxHitObject::MakeNop|Miss lowering and tests
- HLSL -> DXIL lowering - ast, hlsl->dxil, dxilgen, and ScalarReplAggregatesHLSL tests SER implementation tracker (#7214)
1 parent 33bc44a commit f79d0ca

12 files changed

Lines changed: 226 additions & 10 deletions

File tree

include/dxc/HLSL/HLOperations.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ const unsigned kNodeHandleToResCastOpIdx = 1;
433433
const unsigned kAnnotateNodeHandleNodePropIdx = 2;
434434
const unsigned kAnnotateNodeRecordHandleNodeRecordPropIdx = 2;
435435

436+
// HitObject::MakeMiss
437+
const int kHitObjectMakeMiss_NumOp = 8;
438+
const unsigned kHitObjectMakeMissRayDescOpIdx = 4;
439+
436440
} // namespace HLOperandIndex
437441

438442
llvm::Function *GetOrCreateHLFunction(llvm::Module &M,

include/dxc/HlslIntrinsicOp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ enum class IntrinsicOp {
333333
MOP_TraceRayInline = 325,
334334
MOP_WorldRayDirection = 326,
335335
MOP_WorldRayOrigin = 327,
336+
MOP_DxHitObject_MakeMiss = 360,
336337
MOP_DxHitObject_MakeNop = 358,
337338
IOP_DxMaybeReorderThread = 359,
338339
MOP_Count = 328,
@@ -366,7 +367,7 @@ enum class IntrinsicOp {
366367
IOP_usign = 355,
367368
MOP_InterlockedUMax = 356,
368369
MOP_InterlockedUMin = 357,
369-
Num_Intrinsics = 360,
370+
Num_Intrinsics = 361,
370371
};
371372
inline bool HasUnsignedIntrinsicOpcode(IntrinsicOp opcode) {
372373
switch (opcode) {

lib/HLSL/HLOperationLower.cpp

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6068,7 +6068,53 @@ Value *TranslateHitObjectMake(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
60686068
HLOperationLowerHelper &helper,
60696069
HLObjectOperationLowerHelper *pObjHelper,
60706070
bool &Translated) {
6071-
return UndefValue::get(CI->getType()); // TODO: Merge SER DXIL patches
6071+
hlsl::OP *hlslOP = &helper.hlslOP;
6072+
IRBuilder<> Builder(CI);
6073+
int SrcIdx = 1;
6074+
Value *HitObjectPtr = CI->getArgOperand(SrcIdx++);
6075+
if (opcode == OP::OpCode::HitObject_MakeNop) {
6076+
Value *HitObject = TrivialDxilOperation(
6077+
opcode, {nullptr}, Type::getVoidTy(CI->getContext()), CI, hlslOP);
6078+
Builder.CreateStore(HitObject, HitObjectPtr);
6079+
// Passthru the 'this' pointer when this calls 'HitObject_MakeNop' as the
6080+
// default constructor
6081+
if (!CI->getType()->isVoidTy())
6082+
return HitObjectPtr;
6083+
return nullptr;
6084+
}
6085+
6086+
DXASSERT_NOMSG(CI->getNumArgOperands() ==
6087+
HLOperandIndex::kHitObjectMakeMiss_NumOp);
6088+
Value *RayFlags = CI->getArgOperand(SrcIdx++);
6089+
Value *MissShaderIdx = CI->getArgOperand(SrcIdx++);
6090+
Value *RayDescOrigin = CI->getArgOperand(SrcIdx++);
6091+
Value *RayDescOriginX =
6092+
Builder.CreateExtractElement(RayDescOrigin, (uint64_t)0);
6093+
Value *RayDescOriginY =
6094+
Builder.CreateExtractElement(RayDescOrigin, (uint64_t)1);
6095+
Value *RayDescOriginZ =
6096+
Builder.CreateExtractElement(RayDescOrigin, (uint64_t)2);
6097+
6098+
Value *RayDescTMin = CI->getArgOperand(SrcIdx++);
6099+
Value *RayDescDirection = CI->getArgOperand(SrcIdx++);
6100+
Value *RayDescDirectionX =
6101+
Builder.CreateExtractElement(RayDescDirection, (uint64_t)0);
6102+
Value *RayDescDirectionY =
6103+
Builder.CreateExtractElement(RayDescDirection, (uint64_t)1);
6104+
Value *RayDescDirectionZ =
6105+
Builder.CreateExtractElement(RayDescDirection, (uint64_t)2);
6106+
6107+
Value *RayDescTMax = CI->getArgOperand(SrcIdx++);
6108+
DXASSERT_NOMSG(SrcIdx == CI->getNumArgOperands());
6109+
6110+
Value *OutHitObject = TrivialDxilOperation(
6111+
opcode,
6112+
{nullptr, RayFlags, MissShaderIdx, RayDescOriginX, RayDescOriginY,
6113+
RayDescOriginZ, RayDescTMin, RayDescDirectionX, RayDescDirectionY,
6114+
RayDescDirectionZ, RayDescTMax},
6115+
helper.voidTy, CI, hlslOP);
6116+
Builder.CreateStore(OutHitObject, HitObjectPtr);
6117+
return nullptr;
60726118
}
60736119

60746120
Value *TranslateMaybeReorderThread(CallInst *CI, IntrinsicOp IOP,
@@ -6813,11 +6859,12 @@ IntrinsicLower gLowerTable[] = {
68136859
{IntrinsicOp::MOP_InterlockedUMin, TranslateMopAtomicBinaryOperation,
68146860
DXIL::OpCode::NumOpCodes},
68156861
{IntrinsicOp::MOP_DxHitObject_MakeNop, TranslateHitObjectMake,
6816-
DXIL::OpCode::NumOpCodes_Dxil_1_8}, // FIXME: Just a placeholder Dxil
6817-
// opcode
6862+
DXIL::OpCode::HitObject_MakeNop},
68186863
{IntrinsicOp::IOP_DxMaybeReorderThread, TranslateMaybeReorderThread,
68196864
DXIL::OpCode::NumOpCodes_Dxil_1_8}, // FIXME: Just a placeholder Dxil
68206865
// opcode
6866+
{IntrinsicOp::MOP_DxHitObject_MakeMiss, TranslateHitObjectMake,
6867+
DXIL::OpCode::HitObject_MakeMiss},
68216868
};
68226869
} // namespace
68236870
static_assert(

lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,6 +2771,14 @@ void SROA_Helper::RewriteCall(CallInst *CI) {
27712771
RewriteCallArg(CI, HLOperandIndex::kCallShaderPayloadOpIdx,
27722772
/*bIn*/ true, /*bOut*/ true);
27732773
} break;
2774+
case IntrinsicOp::MOP_DxHitObject_MakeMiss: {
2775+
if (OldVal ==
2776+
CI->getArgOperand(HLOperandIndex::kHitObjectMakeMissRayDescOpIdx)) {
2777+
RewriteWithFlattenedHLIntrinsicCall(CI, OldVal, NewElts,
2778+
/*loadElts*/ true);
2779+
DeadInsts.push_back(CI);
2780+
}
2781+
} break;
27742782
case IntrinsicOp::MOP_TraceRayInline: {
27752783
if (OldVal ==
27762784
CI->getArgOperand(HLOperandIndex::kTraceRayInlineRayDescOpIdx)) {

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11911,6 +11911,7 @@ void Sema::DiagnoseReachableHLSLCall(CallExpr *CE, const hlsl::ShaderModel *SM,
1191111911
case hlsl::IntrinsicOp::MOP_TraceRayInline:
1191211912
DiagnoseTraceRayInline(*this, CE);
1191311913
break;
11914+
case hlsl::IntrinsicOp::MOP_DxHitObject_MakeMiss:
1191411915
case hlsl::IntrinsicOp::MOP_DxHitObject_MakeNop:
1191511916
DiagnoseReachableSERCall(*this, CE, EntrySK, EntryDecl, false);
1191611917
break;

tools/clang/test/DXC/Passes/DxilGen/hitobject_dxilgen.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s
22
; REQUIRES: dxil-1-9
33

4-
; CHECK-NOT: @dx.op.hitObject_
5-
; CHECK-NOT: @dx.op.maybeReorderThread
6-
74
;
85
; Buffer Definitions:
96
;
@@ -37,9 +34,11 @@ entry:
3734
%tmp = alloca %dx.types.HitObject, align 4
3835
%0 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !19 ; line:9 col:3
3936
call void @llvm.lifetime.start(i64 4, i8* %0) #0, !dbg !19 ; line:9 col:3
37+
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266)
4038
%1 = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %hit), !dbg !23 ; line:9 col:17
4139
%2 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !24 ; line:10 col:3
4240
call void @llvm.lifetime.start(i64 4, i8* %2) #0, !dbg !24 ; line:10 col:3
41+
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266)
4342
call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %tmp), !dbg !24 ; line:10 col:3
4443
%3 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !24 ; line:10 col:3
4544
call void @llvm.lifetime.end(i64 4, i8* %3) #0, !dbg !24 ; line:10 col:3

tools/clang/test/DXC/Passes/DxilGen/maybereorder_dxilgen.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s
22
; REQUIRES: dxil-1-9
33

4-
; CHECK-NOT: @dx.op.hitObject_
54
; CHECK-NOT: @dx.op.maybeReorderThread
65

76
;
@@ -36,6 +35,7 @@ entry:
3635
%hit = alloca %dx.types.HitObject, align 4
3736
%0 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !19 ; line:9 col:3
3837
call void @llvm.lifetime.start(i64 4, i8* %0) #0, !dbg !19 ; line:9 col:3
38+
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266)
3939
%1 = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %hit), !dbg !23 ; line:9 col:17
4040
call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 359, %dx.types.HitObject* %hit), !dbg !24 ; line:10 col:3
4141
call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32)"(i32 359, %dx.types.HitObject* %hit, i32 241, i32 3), !dbg !25 ; line:11 col:3
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
; RUN: %dxopt %s -hlsl-passes-resume -scalarrepl-param-hlsl -S | FileCheck %s
2+
; REQUIRES: dxil-1-9
3+
4+
;
5+
; Buffer Definitions:
6+
;
7+
; cbuffer $Globals
8+
; {
9+
;
10+
; [0 x i8] (type annotation not present)
11+
;
12+
; }
13+
;
14+
;
15+
; Resource Bindings:
16+
;
17+
; Name Type Format Dim ID HLSL Bind Count
18+
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
19+
; $Globals cbuffer NA NA CB0 cb4294967295 1
20+
;
21+
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"
22+
target triple = "dxil-ms-dx"
23+
24+
%ConstantBuffer = type opaque
25+
%dx.types.HitObject = type { i8* }
26+
%"class.dx::HitObject" = type { i32 }
27+
%struct.RayDesc = type { <3 x float>, float, <3 x float>, float }
28+
29+
@"$Globals" = external constant %ConstantBuffer
30+
31+
; Function Attrs: nounwind
32+
define void @"\01?main@@YAXXZ"() #0 {
33+
entry:
34+
%hit = alloca %dx.types.HitObject, align 4
35+
%tmp = alloca %dx.types.HitObject, align 4
36+
%ray = alloca %struct.RayDesc, align 4
37+
%tmp2 = alloca %dx.types.HitObject, align 4
38+
%0 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !23 ; line:42 col:3
39+
call void @llvm.lifetime.start(i64 4, i8* %0) #0, !dbg !23 ; line:42 col:3
40+
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
41+
%1 = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %hit), !dbg !27 ; line:42 col:17
42+
%2 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !28 ; line:43 col:3
43+
call void @llvm.lifetime.start(i64 4, i8* %2) #0, !dbg !28 ; line:43 col:3
44+
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
45+
call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %tmp), !dbg !28 ; line:43 col:3
46+
%3 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !28 ; line:43 col:3
47+
call void @llvm.lifetime.end(i64 4, i8* %3) #0, !dbg !28 ; line:43 col:3
48+
%4 = bitcast %struct.RayDesc* %ray to i8*, !dbg !29 ; line:44 col:3
49+
call void @llvm.lifetime.start(i64 32, i8* %4) #0, !dbg !29 ; line:44 col:3
50+
%5 = getelementptr inbounds %struct.RayDesc, %struct.RayDesc* %ray, i32 0, i32 0, !dbg !30 ; line:44 col:17
51+
store <3 x float> zeroinitializer, <3 x float>* %5, !dbg !30 ; line:44 col:17
52+
%6 = getelementptr inbounds %struct.RayDesc, %struct.RayDesc* %ray, i32 0, i32 1, !dbg !30 ; line:44 col:17
53+
store float 0.000000e+00, float* %6, !dbg !30 ; line:44 col:17
54+
%7 = getelementptr inbounds %struct.RayDesc, %struct.RayDesc* %ray, i32 0, i32 2, !dbg !30 ; line:44 col:17
55+
store <3 x float> <float 0.000000e+00, float 1.000000e+00, float 0x3FA99999A0000000>, <3 x float>* %7, !dbg !30 ; line:44 col:17
56+
%8 = getelementptr inbounds %struct.RayDesc, %struct.RayDesc* %ray, i32 0, i32 3, !dbg !30 ; line:44 col:17
57+
store float 1.000000e+03, float* %8, !dbg !30 ; line:44 col:17
58+
%9 = bitcast %dx.types.HitObject* %tmp2 to i8*, !dbg !31 ; line:45 col:3
59+
call void @llvm.lifetime.start(i64 4, i8* %9) #0, !dbg !31 ; line:45 col:3
60+
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 360, %dx.types.HitObject* %{{[^ ]+}}, i32 0, i32 1, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}}, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}})
61+
call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*)"(i32 360, %dx.types.HitObject* %tmp2, i32 0, i32 1, %struct.RayDesc* %ray), !dbg !31 ; line:45 col:3
62+
%10 = bitcast %dx.types.HitObject* %tmp2 to i8*, !dbg !31 ; line:45 col:3
63+
call void @llvm.lifetime.end(i64 4, i8* %10) #0, !dbg !31 ; line:45 col:3
64+
%11 = bitcast %struct.RayDesc* %ray to i8*, !dbg !32 ; line:46 col:1
65+
call void @llvm.lifetime.end(i64 32, i8* %11) #0, !dbg !32 ; line:46 col:1
66+
%12 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !32 ; line:46 col:1
67+
call void @llvm.lifetime.end(i64 4, i8* %12) #0, !dbg !32 ; line:46 col:1
68+
ret void, !dbg !32 ; line:46 col:1
69+
}
70+
71+
; Function Attrs: nounwind
72+
declare void @llvm.lifetime.start(i64, i8* nocapture) #0
73+
74+
; Function Attrs: nounwind
75+
declare void @llvm.lifetime.end(i64, i8* nocapture) #0
76+
77+
; Function Attrs: nounwind
78+
declare %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32, %dx.types.HitObject*) #0
79+
80+
; Function Attrs: nounwind
81+
declare void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32, %dx.types.HitObject*) #0
82+
83+
; Function Attrs: nounwind
84+
declare void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*)"(i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*) #0
85+
86+
attributes #0 = { nounwind }
87+
88+
!llvm.module.flags = !{!0}
89+
!pauseresume = !{!1}
90+
!dx.version = !{!2}
91+
!dx.valver = !{!2}
92+
!dx.shaderModel = !{!3}
93+
!dx.typeAnnotations = !{!4, !12}
94+
!dx.entryPoints = !{!16}
95+
!dx.fnprops = !{!20}
96+
!dx.options = !{!21, !22}
97+
98+
!0 = !{i32 2, !"Debug Info Version", i32 3}
99+
!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"}
100+
!2 = !{i32 1, i32 9}
101+
!3 = !{!"lib", i32 6, i32 9}
102+
!4 = !{i32 0, %"class.dx::HitObject" undef, !5, %struct.RayDesc undef, !7}
103+
!5 = !{i32 4, !6}
104+
!6 = !{i32 6, !"h", i32 3, i32 0, i32 7, i32 4}
105+
!7 = !{i32 32, !8, !9, !10, !11}
106+
!8 = !{i32 6, !"Origin", i32 3, i32 0, i32 7, i32 9, i32 13, i32 3}
107+
!9 = !{i32 6, !"TMin", i32 3, i32 12, i32 7, i32 9}
108+
!10 = !{i32 6, !"Direction", i32 3, i32 16, i32 7, i32 9, i32 13, i32 3}
109+
!11 = !{i32 6, !"TMax", i32 3, i32 28, i32 7, i32 9}
110+
!12 = !{i32 1, void ()* @"\01?main@@YAXXZ", !13}
111+
!13 = !{!14}
112+
!14 = !{i32 1, !15, !15}
113+
!15 = !{}
114+
!16 = !{null, !"", null, !17, null}
115+
!17 = !{null, null, !18, null}
116+
!18 = !{!19}
117+
!19 = !{i32 0, %ConstantBuffer* @"$Globals", !"$Globals", i32 0, i32 -1, i32 1, i32 0, null}
118+
!20 = !{void ()* @"\01?main@@YAXXZ", i32 7}
119+
!21 = !{i32 -2147483584}
120+
!22 = !{i32 -1}
121+
!23 = !DILocation(line: 42, column: 3, scope: !24)
122+
!24 = !DISubprogram(name: "main", scope: !25, file: !25, line: 41, type: !26, isLocal: false, isDefinition: true, scopeLine: 41, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @"\01?main@@YAXXZ")
123+
!25 = !DIFile(filename: "tools/clang/test/HLSLFileCheck/hlsl/objects/HitObject/hitobject_make_ast.hlsl", directory: "")
124+
!26 = !DISubroutineType(types: !15)
125+
!27 = !DILocation(line: 42, column: 17, scope: !24)
126+
!28 = !DILocation(line: 43, column: 3, scope: !24)
127+
!29 = !DILocation(line: 44, column: 3, scope: !24)
128+
!30 = !DILocation(line: 44, column: 17, scope: !24)
129+
!31 = !DILocation(line: 45, column: 3, scope: !24)
130+
!32 = !DILocation(line: 46, column: 1, scope: !24)

tools/clang/test/HLSLFileCheck/hlsl/objects/HitObject/hitobject_make.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
void main() {
1010
dx::HitObject hit;
1111
dx::HitObject::MakeNop();
12+
RayDesc ray = {{0,0,0}, {0,0,1}, 0.05, 1000.0};
13+
dx::HitObject::MakeMiss(0, 1, ray);
1214
}

tools/clang/test/HLSLFileCheck/hlsl/objects/HitObject/hitobject_make_ast.hlsl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@
99
// CHECK-NEXT: | | | |-HLSLIntrinsicAttr {{[^ ]+}} <<invalid sloc>> Implicit "op" "" 358
1010
// CHECK-NEXT: | | | `-HLSLCXXOverloadAttr {{[^ ]+}} <<invalid sloc>> Implicit
1111

12+
// CHECK: | | |-FunctionTemplateDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> MakeMiss
13+
// CHECK-NEXT: | | | |-TemplateTypeParmDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> class TResult
14+
// CHECK-NEXT: | | | |-TemplateTypeParmDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> class TRayFlags
15+
// CHECK-NEXT: | | | |-TemplateTypeParmDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> class TMissShaderIndex
16+
// CHECK-NEXT: | | | |-TemplateTypeParmDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> class TRay
17+
// CHECK-NEXT: | | | |-CXXMethodDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> implicit MakeMiss 'TResult (TRayFlags, TMissShaderIndex, TRay) const' static
18+
// CHECK-NEXT: | | | | |-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> RayFlags 'TRayFlags'
19+
// CHECK-NEXT: | | | | |-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> MissShaderIndex 'TMissShaderIndex'
20+
// CHECK-NEXT: | | | | `-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> Ray 'TRay'
21+
// CHECK-NEXT: | | | `-CXXMethodDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> used MakeMiss 'dx::HitObject (unsigned int, unsigned int, RayDesc)' static
22+
// CHECK-NEXT: | | | |-TemplateArgument type 'dx::HitObject'
23+
// CHECK-NEXT: | | | |-TemplateArgument type 'unsigned int'
24+
// CHECK-NEXT: | | | |-TemplateArgument type 'unsigned int'
25+
// CHECK-NEXT: | | | |-TemplateArgument type 'RayDesc'
26+
// CHECK-NEXT: | | | |-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> MakeMiss 'unsigned int'
27+
// CHECK-NEXT: | | | |-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> RayFlags 'unsigned int'
28+
// CHECK-NEXT: | | | |-ParmVarDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> MissShaderIndex 'RayDesc'
29+
// CHECK-NEXT: | | | |-HLSLIntrinsicAttr {{[^ ]+}} <<invalid sloc>> Implicit "op" "" 360
30+
// CHECK-NEXT: | | | `-AvailabilityAttr {{[^ ]+}} <<invalid sloc>> Implicit 6.9 0 0 ""
31+
1232
// CHECK: | | |-FunctionTemplateDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> MakeNop
1333
// CHECK-NEXT: | | | |-TemplateTypeParmDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> class TResult
1434
// CHECK-NEXT: | | | |-CXXMethodDecl {{[^ ]+}} <<invalid sloc>> <invalid sloc> implicit MakeNop 'TResult () const' static
@@ -21,4 +41,6 @@
2141
void main() {
2242
dx::HitObject hit;
2343
dx::HitObject::MakeNop();
44+
RayDesc ray = {{0,0,0}, {0,0,1}, 0.05, 1000.0};
45+
dx::HitObject::MakeMiss(0, 1, ray);
2446
}

0 commit comments

Comments
 (0)