Skip to content

Commit ff53861

Browse files
authored
[SM6.10] Complete TriangleObjectPositions implementation (#8097)
- Lowering for all TriangleObjectPositions variants with tests (renaming HLSL intrinsics to match spec) - BuiltInTrianglePositions struct definition and tests - Validation logic with expected pass and fail tests Closes #8030 #8031 #8032 #8033
1 parent 230e5a1 commit ff53861

File tree

17 files changed

+846
-35
lines changed

17 files changed

+846
-35
lines changed

include/dxc/HLSL/HLOperations.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ const unsigned kOpcodeIdx = 0;
160160
// Used to initialize values that have no valid index in the HL overload.
161161
const unsigned kInvalidIdx = UINT32_MAX;
162162

163+
// HL intrinsic operations place the SRet return pointer at operand index 1,
164+
// since the first argument is reserved for the HL OpCode.
165+
const unsigned kIOP_SRetOpIdx = 1;
166+
163167
// Matrix store.
164168
const unsigned kMatStoreDstPtrOpIdx = 1;
165169
const unsigned kMatStoreValOpIdx = 2;

include/dxc/HlslIntrinsicOp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ enum class IntrinsicOp {
7878
IOP_ReportHit = 67,
7979
IOP_SetMeshOutputCounts = 68,
8080
IOP_TraceRay = 69,
81-
IOP_TriangleObjectPosition = 401,
81+
IOP_TriangleObjectPositions = 401,
8282
IOP_WaveActiveAllEqual = 70,
8383
IOP_WaveActiveAllTrue = 71,
8484
IOP_WaveActiveAnyTrue = 72,
@@ -339,7 +339,7 @@ enum class IntrinsicOp {
339339
MOP_CandidateProceduralPrimitiveNonOpaque = 298,
340340
MOP_CandidateTriangleBarycentrics = 299,
341341
MOP_CandidateTriangleFrontFace = 300,
342-
MOP_CandidateTriangleObjectPosition = 402,
342+
MOP_CandidateTriangleObjectPositions = 402,
343343
MOP_CandidateTriangleRayT = 301,
344344
MOP_CandidateType = 302,
345345
MOP_CandidateWorldToObject3x4 = 303,
@@ -360,7 +360,7 @@ enum class IntrinsicOp {
360360
MOP_CommittedStatus = 317,
361361
MOP_CommittedTriangleBarycentrics = 318,
362362
MOP_CommittedTriangleFrontFace = 319,
363-
MOP_CommittedTriangleObjectPosition = 403,
363+
MOP_CommittedTriangleObjectPositions = 403,
364364
MOP_CommittedWorldToObject3x4 = 320,
365365
MOP_CommittedWorldToObject4x3 = 321,
366366
MOP_Proceed = 322,
@@ -398,7 +398,7 @@ enum class IntrinsicOp {
398398
MOP_DxHitObject_MakeNop = 358,
399399
MOP_DxHitObject_SetShaderTableIndex = 388,
400400
MOP_DxHitObject_TraceRay = 389,
401-
MOP_DxHitObject_TriangleObjectPosition = 404,
401+
MOP_DxHitObject_TriangleObjectPositions = 404,
402402
IOP_DxMaybeReorderThread = 359,
403403
MOP_Count = 328,
404404
MOP_FinishedCrossGroupSharing = 329,

include/dxc/dxcapi.internal.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,13 @@ enum LEGAL_INTRINSIC_COMPTYPES {
134134
// i32, i16, u32, u16,
135135
// int8_4packed, uint8_4packed
136136

137+
LICOMPTYPE_BUILTIN_TRIANGLE_POSITIONS = 54,
138+
137139
#ifdef ENABLE_SPIRV_CODEGEN
138-
LICOMPTYPE_VK_BUFFER_POINTER = 54,
139-
LICOMPTYPE_COUNT = 55
140+
LICOMPTYPE_VK_BUFFER_POINTER = 55,
141+
LICOMPTYPE_COUNT = 56
140142
#else
141-
LICOMPTYPE_COUNT = 54
143+
LICOMPTYPE_COUNT = 55
142144
#endif
143145
};
144146

lib/DxilValidation/DxilValidation.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,17 +2350,20 @@ static void ValidateDxilOperationCallInProfile(CallInst *CI,
23502350
DxilInst_HitObject_TraceRay HOTraceRay(CI);
23512351
} break;
23522352

2353-
// Clustered Geometry intrinsics
2353+
// Clustered Geometry & Triangle Object Positions intrinsics
23542354
case DXIL::OpCode::RayQuery_CandidateClusterID:
2355-
case DXIL::OpCode::RayQuery_CommittedClusterID: {
2355+
case DXIL::OpCode::RayQuery_CommittedClusterID:
2356+
case DXIL::OpCode::RayQuery_CandidateTriangleObjectPosition:
2357+
case DXIL::OpCode::RayQuery_CommittedTriangleObjectPosition: {
23562358
// Validate rayQueryHandle is not undef
23572359
Value *RayQueryHandle = CI->getArgOperand(1);
23582360
if (isa<UndefValue>(RayQueryHandle))
23592361
ValCtx.EmitInstrError(CI, ValidationRule::InstrNoReadingUninitialized);
23602362
break;
23612363
}
23622364

2363-
case DXIL::OpCode::HitObject_ClusterID: {
2365+
case DXIL::OpCode::HitObject_ClusterID:
2366+
case DXIL::OpCode::HitObject_TriangleObjectPosition: {
23642367
// Validate HitObject is not undef
23652368
Value *HitObject = CI->getArgOperand(1);
23662369
if (isa<UndefValue>(HitObject))

lib/HLSL/HLOperationLower.cpp

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6016,6 +6016,108 @@ Value *TranslateNoArgVectorOperation(CallInst *CI, IntrinsicOp IOP,
60166016
return retVal;
60176017
}
60186018

6019+
static Value *ConstructBuiltInTrianglePositionsFromFloat9(
6020+
Value *float9Vec, StructType *hlslStructTy, IRBuilder<> &Builder) {
6021+
Type *f32Ty = Type::getFloatTy(Builder.getContext());
6022+
Type *float3Ty = VectorType::get(f32Ty, 3);
6023+
Value *result = UndefValue::get(hlslStructTy);
6024+
6025+
// Build p0, p1, p2 from vector elements 0-2, 3-5, 6-8
6026+
for (unsigned field = 0; field < 3; field++) {
6027+
Value *float3 = UndefValue::get(float3Ty);
6028+
for (unsigned i = 0; i < 3; i++) {
6029+
Value *elem = Builder.CreateExtractElement(float9Vec, field * 3 + i);
6030+
float3 = Builder.CreateInsertElement(float3, elem, i);
6031+
}
6032+
result = Builder.CreateInsertValue(result, float3, field);
6033+
}
6034+
6035+
return result;
6036+
}
6037+
6038+
Value *TranslateTriangleObjectPositions(
6039+
CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
6040+
HLOperationLowerHelper &helper, HLObjectOperationLowerHelper *pObjHelper,
6041+
bool &Translated) {
6042+
hlsl::OP *hlslOP = &helper.hlslOP;
6043+
IRBuilder<> Builder(CI);
6044+
6045+
Value *outputPtr = CI->getArgOperand(HLOperandIndex::kIOP_SRetOpIdx);
6046+
StructType *hlslStructTy =
6047+
cast<StructType>(outputPtr->getType()->getPointerElementType());
6048+
6049+
Type *f32Ty = Type::getFloatTy(CI->getContext());
6050+
Function *dxilFunc = hlslOP->GetOpFunc(opcode, f32Ty);
6051+
Constant *opArg = hlslOP->GetU32Const((unsigned)opcode);
6052+
6053+
Value *dxilCall = Builder.CreateCall(dxilFunc, {opArg});
6054+
6055+
Value *structValue = ConstructBuiltInTrianglePositionsFromFloat9(
6056+
dxilCall, hlslStructTy, Builder);
6057+
Builder.CreateStore(structValue, outputPtr);
6058+
6059+
return nullptr;
6060+
}
6061+
6062+
Value *TranslateRayQueryTriangleObjectPositions(
6063+
CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
6064+
HLOperationLowerHelper &helper, HLObjectOperationLowerHelper *pObjHelper,
6065+
bool &Translated) {
6066+
hlsl::OP *hlslOP = &helper.hlslOP;
6067+
6068+
Value *handle = CI->getArgOperand(HLOperandIndex::kHandleOpIdx);
6069+
StructType *hlslStructTy =
6070+
cast<StructType>(CI->getType()->getPointerElementType());
6071+
6072+
Function *F = CI->getParent()->getParent();
6073+
IRBuilder<> AllocaBuilder(&F->getEntryBlock(), F->getEntryBlock().begin());
6074+
AllocaInst *resultAlloca = AllocaBuilder.CreateAlloca(hlslStructTy);
6075+
6076+
IRBuilder<> Builder(CI);
6077+
6078+
Type *f32Ty = Type::getFloatTy(CI->getContext());
6079+
Function *dxilFunc = hlslOP->GetOpFunc(opcode, f32Ty);
6080+
Constant *opArg = hlslOP->GetU32Const((unsigned)opcode);
6081+
6082+
Value *dxilCall = Builder.CreateCall(dxilFunc, {opArg, handle});
6083+
6084+
Value *structValue = ConstructBuiltInTrianglePositionsFromFloat9(
6085+
dxilCall, hlslStructTy, Builder);
6086+
Builder.CreateStore(structValue, resultAlloca);
6087+
6088+
return resultAlloca;
6089+
}
6090+
6091+
Value *TranslateHitObjectTriangleObjectPositions(
6092+
CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
6093+
HLOperationLowerHelper &helper, HLObjectOperationLowerHelper *pObjHelper,
6094+
bool &Translated) {
6095+
hlsl::OP *hlslOP = &helper.hlslOP;
6096+
6097+
Value *hitObjectPtr = CI->getArgOperand(HLOperandIndex::kHandleOpIdx);
6098+
StructType *hlslStructTy =
6099+
cast<StructType>(CI->getType()->getPointerElementType());
6100+
6101+
Function *F = CI->getParent()->getParent();
6102+
IRBuilder<> AllocaBuilder(&F->getEntryBlock(), F->getEntryBlock().begin());
6103+
AllocaInst *resultAlloca = AllocaBuilder.CreateAlloca(hlslStructTy);
6104+
6105+
IRBuilder<> Builder(CI);
6106+
Value *hitObject = Builder.CreateLoad(hitObjectPtr);
6107+
6108+
Type *f32Ty = Type::getFloatTy(CI->getContext());
6109+
Function *dxilFunc = hlslOP->GetOpFunc(opcode, f32Ty);
6110+
Constant *opArg = hlslOP->GetU32Const((unsigned)opcode);
6111+
6112+
Value *dxilCall = Builder.CreateCall(dxilFunc, {opArg, hitObject});
6113+
6114+
Value *structValue = ConstructBuiltInTrianglePositionsFromFloat9(
6115+
dxilCall, hlslStructTy, Builder);
6116+
Builder.CreateStore(structValue, resultAlloca);
6117+
6118+
return resultAlloca;
6119+
}
6120+
60196121
template <typename ColElemTy>
60206122
static void GetMatrixIndices(Constant *&Rows, Constant *&Cols, bool Is3x4,
60216123
LLVMContext &Ctx) {
@@ -7543,13 +7645,16 @@ constexpr IntrinsicLower gLowerTable[] = {
75437645
{IntrinsicOp::MOP_DxHitObject_GetClusterID, TranslateHitObjectScalarGetter,
75447646
DXIL::OpCode::HitObject_ClusterID},
75457647

7546-
{IntrinsicOp::IOP_TriangleObjectPosition, EmptyLower,
7648+
{IntrinsicOp::IOP_TriangleObjectPositions, TranslateTriangleObjectPositions,
75477649
DXIL::OpCode::TriangleObjectPosition},
7548-
{IntrinsicOp::MOP_CandidateTriangleObjectPosition, EmptyLower,
7650+
{IntrinsicOp::MOP_CandidateTriangleObjectPositions,
7651+
TranslateRayQueryTriangleObjectPositions,
75497652
DXIL::OpCode::RayQuery_CandidateTriangleObjectPosition},
7550-
{IntrinsicOp::MOP_CommittedTriangleObjectPosition, EmptyLower,
7653+
{IntrinsicOp::MOP_CommittedTriangleObjectPositions,
7654+
TranslateRayQueryTriangleObjectPositions,
75517655
DXIL::OpCode::RayQuery_CommittedTriangleObjectPosition},
7552-
{IntrinsicOp::MOP_DxHitObject_TriangleObjectPosition, EmptyLower,
7656+
{IntrinsicOp::MOP_DxHitObject_TriangleObjectPositions,
7657+
TranslateHitObjectTriangleObjectPositions,
75537658
DXIL::OpCode::HitObject_TriangleObjectPosition},
75547659

75557660
{IntrinsicOp::IOP___builtin_LinAlg_CopyConvertMatrix, EmptyLower,

lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,11 @@ static bool isUDTIntrinsicArg(CallInst *CI, unsigned OpIdx) {
15001500
if (OpIdx == HLOperandIndex::kCallShaderPayloadOpIdx)
15011501
return true;
15021502
break;
1503+
case IntrinsicOp::IOP_TriangleObjectPositions:
1504+
// Not UDT exactly, but sret parameter that needs the same treatment.
1505+
if (OpIdx == HLOperandIndex::kIOP_SRetOpIdx)
1506+
return true;
1507+
break;
15031508
case IntrinsicOp::MOP_DxHitObject_FromRayQuery:
15041509
if (NumOps == HLOperandIndex::kHitObjectFromRayQuery_WithAttrs_NumOp &&
15051510
OpIdx ==

tools/clang/lib/AST/HlslTypes.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ bool IsHLSLBuiltinRayAttributeStruct(clang::QualType QT) {
136136
if (const RecordType *RT = dyn_cast<RecordType>(Ty)) {
137137
const RecordDecl *RD = RT->getDecl();
138138
if (RD->getName() == "BuiltInTriangleIntersectionAttributes" ||
139-
RD->getName() == "RayDesc")
139+
RD->getName() == "RayDesc" ||
140+
RD->getName() == "BuiltInTrianglePositions")
140141
return true;
141142
}
142143
return false;

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ enum ArBasicKind {
211211
AR_OBJECT_ACCELERATION_STRUCT,
212212
AR_OBJECT_USER_DEFINED_TYPE,
213213
AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES,
214+
AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS,
214215

215216
// subobjects
216217
AR_OBJECT_STATE_OBJECT_CONFIG,
@@ -567,6 +568,7 @@ const UINT g_uBasicKindProps[] = {
567568
LICOMPTYPE_ACCELERATION_STRUCT, // AR_OBJECT_ACCELERATION_STRUCT
568569
LICOMPTYPE_USER_DEFINED_TYPE, // AR_OBJECT_USER_DEFINED_TYPE
569570
0, // AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES
571+
LICOMPTYPE_BUILTIN_TRIANGLE_POSITIONS, // AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS
570572

571573
// subobjects
572574
0, // AR_OBJECT_STATE_OBJECT_CONFIG,
@@ -1134,6 +1136,9 @@ static const ArBasicKind g_ResourceCT[] = {AR_OBJECT_HEAP_RESOURCE,
11341136

11351137
static const ArBasicKind g_RayDescCT[] = {AR_OBJECT_RAY_DESC, AR_BASIC_UNKNOWN};
11361138

1139+
static const ArBasicKind g_BuiltInTrianglePositionsCT[] = {
1140+
AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS, AR_BASIC_UNKNOWN};
1141+
11371142
static const ArBasicKind g_RayQueryCT[] = {AR_OBJECT_RAY_QUERY,
11381143
AR_BASIC_UNKNOWN};
11391144

@@ -1300,15 +1305,16 @@ const ArBasicKind *g_LegalIntrinsicCompTypes[] = {
13001305
g_SInt16Or32OnlyCT, // LICOMPTYPE_SINT16_OR_32_ONLY
13011306
g_AnySamplerCT, // LICOMPTYPE_ANY_SAMPLER
13021307

1303-
g_ByteAddressBufferCT, // LICOMPTYPE_BYTEADDRESSBUFFER
1304-
g_RWByteAddressBufferCT, // LICOMPTYPE_RWBYTEADDRESSBUFFER
1305-
g_NodeRecordOrUAVCT, // LICOMPTYPE_NODE_RECORD_OR_UAV
1306-
g_AnyOutputRecordCT, // LICOMPTYPE_ANY_NODE_OUTPUT_RECORD
1307-
g_GroupNodeOutputRecordsCT, // LICOMPTYPE_GROUP_NODE_OUTPUT_RECORDS
1308-
g_ThreadNodeOutputRecordsCT, // LICOMPTYPE_THREAD_NODE_OUTPUT_RECORDS
1309-
g_DxHitObjectCT, // LICOMPTYPE_HIT_OBJECT
1310-
g_RayQueryCT, // LICOMPTYPE_RAY_QUERY
1311-
g_LinAlgCT, // LICOMPTYPE_LINALG
1308+
g_ByteAddressBufferCT, // LICOMPTYPE_BYTEADDRESSBUFFER
1309+
g_RWByteAddressBufferCT, // LICOMPTYPE_RWBYTEADDRESSBUFFER
1310+
g_NodeRecordOrUAVCT, // LICOMPTYPE_NODE_RECORD_OR_UAV
1311+
g_AnyOutputRecordCT, // LICOMPTYPE_ANY_NODE_OUTPUT_RECORD
1312+
g_GroupNodeOutputRecordsCT, // LICOMPTYPE_GROUP_NODE_OUTPUT_RECORDS
1313+
g_ThreadNodeOutputRecordsCT, // LICOMPTYPE_THREAD_NODE_OUTPUT_RECORDS
1314+
g_DxHitObjectCT, // LICOMPTYPE_HIT_OBJECT
1315+
g_RayQueryCT, // LICOMPTYPE_RAY_QUERY
1316+
g_LinAlgCT, // LICOMPTYPE_LINALG
1317+
g_BuiltInTrianglePositionsCT, // LICOMPTYPE_BUILTIN_TRIANGLE_POSITIONS
13121318
#ifdef ENABLE_SPIRV_CODEGEN
13131319
g_VKBufferPointerCT, // LICOMPTYPE_VK_BUFFER_POINTER
13141320
#endif
@@ -1379,6 +1385,7 @@ static const ArBasicKind g_ArBasicKindsAsTypes[] = {
13791385

13801386
AR_OBJECT_WAVE, AR_OBJECT_RAY_DESC, AR_OBJECT_ACCELERATION_STRUCT,
13811387
AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES,
1388+
AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS,
13821389

13831390
// subobjects
13841391
AR_OBJECT_STATE_OBJECT_CONFIG, AR_OBJECT_GLOBAL_ROOT_SIGNATURE,
@@ -1487,6 +1494,7 @@ static const uint8_t g_ArBasicKindsTemplateCount[] = {
14871494
0, // AR_OBJECT_RAY_DESC
14881495
0, // AR_OBJECT_ACCELERATION_STRUCT
14891496
0, // AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES
1497+
0, // AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS
14901498

14911499
0, // AR_OBJECT_STATE_OBJECT_CONFIG,
14921500
0, // AR_OBJECT_GLOBAL_ROOT_SIGNATURE,
@@ -1636,6 +1644,7 @@ static const SubscriptOperatorRecord g_ArBasicKindsSubscripts[] = {
16361644
{0, MipsFalse, SampleFalse}, // AR_OBJECT_RAY_DESC
16371645
{0, MipsFalse, SampleFalse}, // AR_OBJECT_ACCELERATION_STRUCT
16381646
{0, MipsFalse, SampleFalse}, // AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES
1647+
{0, MipsFalse, SampleFalse}, // AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS
16391648

16401649
{0, MipsFalse, SampleFalse}, // AR_OBJECT_STATE_OBJECT_CONFIG,
16411650
{0, MipsFalse, SampleFalse}, // AR_OBJECT_GLOBAL_ROOT_SIGNATURE,
@@ -1803,6 +1812,7 @@ static const char *g_ArBasicTypeNames[] = {
18031812
"RaytracingAccelerationStructure",
18041813
"user defined type",
18051814
"BuiltInTriangleIntersectionAttributes",
1815+
"BuiltInTrianglePositions",
18061816

18071817
// subobjects
18081818
"StateObjectConfig",
@@ -2813,6 +2823,31 @@ AddBuiltInTriangleIntersectionAttributes(ASTContext &context,
28132823
return attributesDecl;
28142824
}
28152825

2826+
// struct BuiltInTrianglePositions
2827+
// {
2828+
// float3 p0, p1, p2;
2829+
// };
2830+
static CXXRecordDecl *CreateBuiltInTrianglePositions(ASTContext &context,
2831+
QualType float3Ty) {
2832+
DeclContext *curDC = context.getTranslationUnitDecl();
2833+
IdentifierInfo &positionsId = context.Idents.get(
2834+
StringRef("BuiltInTrianglePositions"), tok::TokenKind::identifier);
2835+
CXXRecordDecl *positionsDecl = CXXRecordDecl::Create(
2836+
context, TagTypeKind::TTK_Struct, curDC, NoLoc, NoLoc, &positionsId,
2837+
nullptr, DelayTypeCreationTrue);
2838+
positionsDecl->addAttr(
2839+
FinalAttr::CreateImplicit(context, FinalAttr::Keyword_final));
2840+
positionsDecl->startDefinition();
2841+
// float3 p0, p1, p2;
2842+
CreateSimpleField(context, positionsDecl, "p0", float3Ty);
2843+
CreateSimpleField(context, positionsDecl, "p1", float3Ty);
2844+
CreateSimpleField(context, positionsDecl, "p2", float3Ty);
2845+
positionsDecl->completeDefinition();
2846+
positionsDecl->setImplicit(true);
2847+
curDC->addDecl(positionsDecl);
2848+
return positionsDecl;
2849+
}
2850+
28162851
//
28172852
// Subobjects
28182853

@@ -3605,6 +3640,10 @@ class HLSLExternalSource : public ExternalSemaSource {
36053640
case LICOMPTYPE_HIT_OBJECT:
36063641
paramTypes.push_back(GetBasicKindType(AR_OBJECT_HIT_OBJECT));
36073642
break;
3643+
case LICOMPTYPE_BUILTIN_TRIANGLE_POSITIONS:
3644+
paramTypes.push_back(
3645+
GetBasicKindType(AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS));
3646+
break;
36083647
#ifdef ENABLE_SPIRV_CODEGEN
36093648
case LICOMPTYPE_VK_BUFFER_POINTER: {
36103649
const ArBasicKind *match =
@@ -3824,6 +3863,10 @@ class HLSLExternalSource : public ExternalSemaSource {
38243863
LookupVectorType(HLSLScalarType::HLSLScalarType_float, 2);
38253864
recordDecl =
38263865
AddBuiltInTriangleIntersectionAttributes(*m_context, float2Type);
3866+
} else if (kind == AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS) {
3867+
QualType float3Ty =
3868+
LookupVectorType(HLSLScalarType::HLSLScalarType_float, 3);
3869+
recordDecl = CreateBuiltInTrianglePositions(*m_context, float3Ty);
38273870
} else if (IsSubobjectBasicKind(kind)) {
38283871
switch (kind) {
38293872
case AR_OBJECT_STATE_OBJECT_CONFIG:
@@ -4861,6 +4904,7 @@ class HLSLExternalSource : public ExternalSemaSource {
48614904
case AR_OBJECT_RAY_DESC:
48624905
case AR_OBJECT_HIT_OBJECT:
48634906
case AR_OBJECT_TRIANGLE_INTERSECTION_ATTRIBUTES:
4907+
case AR_OBJECT_BUILTIN_TRIANGLE_POSITIONS:
48644908
case AR_OBJECT_RWTEXTURE2DMS:
48654909
case AR_OBJECT_RWTEXTURE2DMS_ARRAY:
48664910

0 commit comments

Comments
 (0)