Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,13 @@ def HLSLRayQueryObject : InheritableAttr {
let Documentation = [Undocumented];
}

def HLSLSubObject : InheritableAttr {
let Spellings = []; // No spellings!
let Subjects = SubjectList<[CXXRecord]>;
let Documentation = [Undocumented];
let Args = [UnsignedArgument<"SubObjKindUint">, UnsignedArgument<"HitGroupType">];
}

// HLSL HitObject Attribute

def HLSLHitObject : InheritableAttr {
Expand Down
64 changes: 10 additions & 54 deletions tools/clang/lib/AST/HlslTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,64 +684,20 @@ bool DoesTypeDefineOverloadedOperator(clang::QualType typeWithOperator,
bool GetHLSLSubobjectKind(clang::QualType type,
DXIL::SubobjectKind &subobjectKind,
DXIL::HitGroupType &hgType) {
hgType = (DXIL::HitGroupType)(-1);
type = type.getCanonicalType();
if (const RecordType *RT = type->getAs<RecordType>()) {
StringRef name = RT->getDecl()->getName();
switch (name.size()) {
case 17:
return name == "StateObjectConfig"
? (subobjectKind = DXIL::SubobjectKind::StateObjectConfig,
true)
: false;
case 18:
return name == "LocalRootSignature"
? (subobjectKind = DXIL::SubobjectKind::LocalRootSignature,
true)
: false;
case 19:
return name == "GlobalRootSignature"
? (subobjectKind = DXIL::SubobjectKind::GlobalRootSignature,
true)
: false;
case 29:
return name == "SubobjectToExportsAssociation"
? (subobjectKind =
DXIL::SubobjectKind::SubobjectToExportsAssociation,
true)
: false;
case 22:
return name == "RaytracingShaderConfig"
? (subobjectKind = DXIL::SubobjectKind::RaytracingShaderConfig,
true)
: false;
case 24:
return name == "RaytracingPipelineConfig"
? (subobjectKind =
DXIL::SubobjectKind::RaytracingPipelineConfig,
true)
: false;
case 25:
return name == "RaytracingPipelineConfig1"
? (subobjectKind =
DXIL::SubobjectKind::RaytracingPipelineConfig1,
true)
: false;
case 16:
if (name == "TriangleHitGroup") {
subobjectKind = DXIL::SubobjectKind::HitGroup;
hgType = DXIL::HitGroupType::Triangle;
return true;
}
return false;
case 27:
if (name == "ProceduralPrimitiveHitGroup") {
subobjectKind = DXIL::SubobjectKind::HitGroup;
hgType = DXIL::HitGroupType::ProceduralPrimitive;
return true;
}
RecordDecl *RD = RT->getDecl();
if (!RD->hasAttr<HLSLSubObjectAttr>()) {
return false;
}
Copy link
Copy Markdown
Collaborator

@pow2clk pow2clk Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that you've added the attribute now, it would be pretty easy to avoid the string compares by adding a parameter to it containing an integer representation of the Subobjectkind similar to how HLSLResourceAttr does. The callers of CreateSubobjectStateObjectConfig and friends that call StartSubObjectDecl have the AR_OBJECT enums, which indicate which DXIL:SubobjectKind they need. It would be pretty easy to plumb it down and apply it to the attr.


HLSLSubObjectAttr *Attr = RD->getAttr<HLSLSubObjectAttr>();
subobjectKind = static_cast<DXIL::SubobjectKind>(Attr->getSubObjKindUint());
hgType = static_cast<DXIL::HitGroupType>(Attr->getHitGroupType());
if (subobjectKind == DXIL::SubobjectKind::HitGroup)
DXASSERT(DXIL::IsValidHitGroupType(hgType), "invalid hit group type");

return true;
}
return false;
}
Expand Down
39 changes: 28 additions & 11 deletions tools/clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2785,13 +2785,17 @@ AddBuiltInTriangleIntersectionAttributes(ASTContext &context,
//
// Subobjects

static CXXRecordDecl *StartSubobjectDecl(ASTContext &context,
const char *name) {
static CXXRecordDecl *
StartSubobjectDecl(ASTContext &context, const char *name,
DXIL::SubobjectKind Kind,
DXIL::HitGroupType HGT = DXIL::HitGroupType::LastEntry) {
IdentifierInfo &id =
context.Idents.get(StringRef(name), tok::TokenKind::identifier);
CXXRecordDecl *decl = CXXRecordDecl::Create(
context, TagTypeKind::TTK_Struct, context.getTranslationUnitDecl(), NoLoc,
NoLoc, &id, nullptr, DelayTypeCreationTrue);
decl->addAttr(HLSLSubObjectAttr::CreateImplicit(
context, static_cast<unsigned>(Kind), static_cast<unsigned>(HGT)));
decl->addAttr(FinalAttr::CreateImplicit(context, FinalAttr::Keyword_final));
decl->startDefinition();
return decl;
Expand All @@ -2808,7 +2812,8 @@ void FinishSubobjectDecl(ASTContext &context, CXXRecordDecl *decl) {
// uint32_t Flags;
// };
static CXXRecordDecl *CreateSubobjectStateObjectConfig(ASTContext &context) {
CXXRecordDecl *decl = StartSubobjectDecl(context, "StateObjectConfig");
CXXRecordDecl *decl = StartSubobjectDecl(
context, "StateObjectConfig", DXIL::SubobjectKind::StateObjectConfig);
CreateSimpleField(context, decl, "Flags", context.UnsignedIntTy,
AccessSpecifier::AS_private);
FinishSubobjectDecl(context, decl);
Expand All @@ -2822,7 +2827,10 @@ static CXXRecordDecl *CreateSubobjectStateObjectConfig(ASTContext &context) {
static CXXRecordDecl *CreateSubobjectRootSignature(ASTContext &context,
bool global) {
CXXRecordDecl *decl = StartSubobjectDecl(
context, global ? "GlobalRootSignature" : "LocalRootSignature");
context, global ? "GlobalRootSignature" : "LocalRootSignature",
global ? DXIL::SubobjectKind::GlobalRootSignature
: DXIL::SubobjectKind::LocalRootSignature);

CreateSimpleField(context, decl, "Data", context.HLSLStringTy,
AccessSpecifier::AS_private);
FinishSubobjectDecl(context, decl);
Expand All @@ -2837,7 +2845,8 @@ static CXXRecordDecl *CreateSubobjectRootSignature(ASTContext &context,
static CXXRecordDecl *
CreateSubobjectSubobjectToExportsAssoc(ASTContext &context) {
CXXRecordDecl *decl =
StartSubobjectDecl(context, "SubobjectToExportsAssociation");
StartSubobjectDecl(context, "SubobjectToExportsAssociation",
DXIL::SubobjectKind::SubobjectToExportsAssociation);
CreateSimpleField(context, decl, "Subobject", context.HLSLStringTy,
AccessSpecifier::AS_private);
CreateSimpleField(context, decl, "Exports", context.HLSLStringTy,
Expand All @@ -2853,7 +2862,9 @@ CreateSubobjectSubobjectToExportsAssoc(ASTContext &context) {
// };
static CXXRecordDecl *
CreateSubobjectRaytracingShaderConfig(ASTContext &context) {
CXXRecordDecl *decl = StartSubobjectDecl(context, "RaytracingShaderConfig");
CXXRecordDecl *decl =
StartSubobjectDecl(context, "RaytracingShaderConfig",
DXIL::SubobjectKind::RaytracingShaderConfig);
CreateSimpleField(context, decl, "MaxPayloadSizeInBytes",
context.UnsignedIntTy, AccessSpecifier::AS_private);
CreateSimpleField(context, decl, "MaxAttributeSizeInBytes",
Expand All @@ -2868,7 +2879,9 @@ CreateSubobjectRaytracingShaderConfig(ASTContext &context) {
// };
static CXXRecordDecl *
CreateSubobjectRaytracingPipelineConfig(ASTContext &context) {
CXXRecordDecl *decl = StartSubobjectDecl(context, "RaytracingPipelineConfig");
CXXRecordDecl *decl =
StartSubobjectDecl(context, "RaytracingPipelineConfig",
DXIL::SubobjectKind::RaytracingPipelineConfig);
CreateSimpleField(context, decl, "MaxTraceRecursionDepth",
context.UnsignedIntTy, AccessSpecifier::AS_private);
FinishSubobjectDecl(context, decl);
Expand All @@ -2883,7 +2896,8 @@ CreateSubobjectRaytracingPipelineConfig(ASTContext &context) {
static CXXRecordDecl *
CreateSubobjectRaytracingPipelineConfig1(ASTContext &context) {
CXXRecordDecl *decl =
StartSubobjectDecl(context, "RaytracingPipelineConfig1");
StartSubobjectDecl(context, "RaytracingPipelineConfig1",
DXIL::SubobjectKind::RaytracingPipelineConfig1);
CreateSimpleField(context, decl, "MaxTraceRecursionDepth",
context.UnsignedIntTy, AccessSpecifier::AS_private);
CreateSimpleField(context, decl, "Flags", context.UnsignedIntTy,
Expand All @@ -2898,7 +2912,9 @@ CreateSubobjectRaytracingPipelineConfig1(ASTContext &context) {
// string ClosestHit;
// };
static CXXRecordDecl *CreateSubobjectTriangleHitGroup(ASTContext &context) {
CXXRecordDecl *decl = StartSubobjectDecl(context, "TriangleHitGroup");
CXXRecordDecl *decl = StartSubobjectDecl(context, "TriangleHitGroup",
DXIL::SubobjectKind::HitGroup,
DXIL::HitGroupType::Triangle);
CreateSimpleField(context, decl, "AnyHit", context.HLSLStringTy,
AccessSpecifier::AS_private);
CreateSimpleField(context, decl, "ClosestHit", context.HLSLStringTy,
Expand All @@ -2915,8 +2931,9 @@ static CXXRecordDecl *CreateSubobjectTriangleHitGroup(ASTContext &context) {
// };
static CXXRecordDecl *
CreateSubobjectProceduralPrimitiveHitGroup(ASTContext &context) {
CXXRecordDecl *decl =
StartSubobjectDecl(context, "ProceduralPrimitiveHitGroup");
CXXRecordDecl *decl = StartSubobjectDecl(
context, "ProceduralPrimitiveHitGroup", DXIL::SubobjectKind::HitGroup,
DXIL::HitGroupType::ProceduralPrimitive);
CreateSimpleField(context, decl, "AnyHit", context.HLSLStringTy,
AccessSpecifier::AS_private);
CreateSimpleField(context, decl, "ClosestHit", context.HLSLStringTy,
Expand Down
136 changes: 136 additions & 0 deletions tools/clang/test/SemaHLSL/subobjects-ast-dump.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// RUN: %dxc -T lib_6_9 -ast-dump-implicit %s | FileCheck -check-prefix=ASTIMPL %s
// RUN: %dxc -T lib_6_9 -ast-dump %s | FileCheck -check-prefix=AST %s
// The HLSL source is just a copy of
// tools\clang\test\HLSLFileCheck\shader_targets\raytracing\subobjects_raytracingPipelineConfig1.hlsl

// This test tests that the HLSLSubObjectAttr attribute is present on all
// HLSL subobjects, and tests the ast representation of subobjects

// ASTIMPL: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct StateObjectConfig definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 0 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Flags 'unsigned int'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct GlobalRootSignature definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 1 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Data 'string'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct LocalRootSignature definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 2 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Data 'string'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct SubobjectToExportsAssociation definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 8 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Subobject 'string'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Exports 'string'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct RaytracingShaderConfig definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 9 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit MaxPayloadSizeInBytes 'unsigned int'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit MaxAttributeSizeInBytes 'unsigned int'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit struct RaytracingPipelineConfig definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 10 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit MaxTraceRecursionDepth 'unsigned int'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct TriangleHitGroup definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 11 0
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit AnyHit 'string'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit ClosestHit 'string'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct ProceduralPrimitiveHitGroup definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 11 1
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit AnyHit 'string'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit ClosestHit 'string'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Intersection 'string'
// ASTIMPL-NEXT: CXXRecordDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced struct RaytracingPipelineConfig1 definition
// ASTIMPL-NEXT: HLSLSubObjectAttr 0x{{.+}} <<invalid sloc>> Implicit 12 2
// ASTIMPL-NEXT: FinalAttr 0x{{.+}} <<invalid sloc>> Implicit final
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit MaxTraceRecursionDepth 'unsigned int'
// ASTIMPL-NEXT: FieldDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit Flags 'unsigned int'

// AST: VarDecl 0x{{.+}} grs 'GlobalRootSignature' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'GlobalRootSignature'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "CBV(b0)"
// AST-NEXT: VarDecl 0x{{.+}} soc 'StateObjectConfig' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'StateObjectConfig'
// AST-NEXT: BinaryOperator 0x{{.+}} 'unsigned int' '|'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <LValueToRValue>
// AST-NEXT: DeclRefExpr 0x{{.+}} 'const unsigned int' lvalue Var 0x{{.+}} 'STATE_OBJECT_FLAGS_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITONS' 'const unsigned int'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <LValueToRValue>
// AST-NEXT: DeclRefExpr 0x{{.+}} 'const unsigned int' lvalue Var 0x{{.+}} 'STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS' 'const unsigned int'
// AST-NEXT: VarDecl 0x{{.+}} lrs 'LocalRootSignature' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'LocalRootSignature'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "UAV(u0, visibility = SHADER_VISIBILITY_GEOMETRY), RootFlags(LOCAL_ROOT_SIGNATURE)"
// AST-NEXT: VarDecl 0x{{.+}} sea 'SubobjectToExportsAssociation' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'SubobjectToExportsAssociation'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "grs"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "a;b;foo;c"
// AST-NEXT: VarDecl 0x{{.+}} sea2 'SubobjectToExportsAssociation' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'SubobjectToExportsAssociation'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "grs"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue ";"
// AST-NEXT: VarDecl 0x{{.+}} sea3 'SubobjectToExportsAssociation' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'SubobjectToExportsAssociation'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "grs"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue ""
// AST-NEXT: VarDecl 0x{{.+}} rsc 'RaytracingShaderConfig' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'RaytracingShaderConfig'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <IntegralCast>
// AST-NEXT: IntegerLiteral 0x{{.+}} 'literal int' 128
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <IntegralCast>
// AST-NEXT: IntegerLiteral 0x{{.+}} 'literal int' 64
// AST-NEXT: VarDecl 0x{{.+}} rpc 'RaytracingPipelineConfig1' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'RaytracingPipelineConfig1'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <IntegralCast>
// AST-NEXT: IntegerLiteral 0x{{.+}} 'literal int' 32
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <LValueToRValue>
// AST-NEXT: DeclRefExpr 0x{{.+}} 'const unsigned int' lvalue Var 0x{{.+}} 'RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES' 'const unsigned int'
// AST-NEXT: VarDecl 0x{{.+}} sea4 'SubobjectToExportsAssociation' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'SubobjectToExportsAssociation'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "rpc"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue ";"
// AST-NEXT: VarDecl 0x{{.+}} rpc2 'RaytracingPipelineConfig1' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'RaytracingPipelineConfig1'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <IntegralCast>
// AST-NEXT: IntegerLiteral 0x{{.+}} 'literal int' 32
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <LValueToRValue>
// AST-NEXT: DeclRefExpr 0x{{.+}} 'const unsigned int' lvalue Var 0x{{.+}} 'RAYTRACING_PIPELINE_FLAG_NONE' 'const unsigned int'
// AST-NEXT: VarDecl 0x{{.+}} trHitGt 'TriangleHitGroup' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'TriangleHitGroup'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "a"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "b"
// AST-NEXT: VarDecl 0x{{.+}} ppHitGt 'ProceduralPrimitiveHitGroup' static cinit
// AST-NEXT: InitListExpr 0x{{.+}} 'ProceduralPrimitiveHitGroup'
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "a"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "b"
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'const string' <ArrayToPointerDecay>
// AST-NEXT: StringLiteral 0x{{.+}} 'literal string' lvalue "c"

GlobalRootSignature grs = {"CBV(b0)"};
StateObjectConfig soc = { STATE_OBJECT_FLAGS_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITONS | STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS };
LocalRootSignature lrs = {"UAV(u0, visibility = SHADER_VISIBILITY_GEOMETRY), RootFlags(LOCAL_ROOT_SIGNATURE)"};
SubobjectToExportsAssociation sea = { "grs", "a;b;foo;c" };
// Empty association is well-defined: it creates a default association
SubobjectToExportsAssociation sea2 = { "grs", ";" };
SubobjectToExportsAssociation sea3 = { "grs", "" };
RaytracingShaderConfig rsc = { 128, 64 };
RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES };
SubobjectToExportsAssociation sea4 = {"rpc", ";"};
RaytracingPipelineConfig1 rpc2 = {32, RAYTRACING_PIPELINE_FLAG_NONE };
TriangleHitGroup trHitGt = {"a", "b"};
ProceduralPrimitiveHitGroup ppHitGt = { "a", "b", "c"};