File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -282,14 +282,15 @@ static bool isResourceRecordTypeOrArrayOf(const Type *Ty) {
282282// array, or a builtin intangible type. Returns false it is a valid leaf element
283283// type or if it is a record type that needs to be inspected further.
284284static bool isInvalidConstantBufferLeafElementType (const Type *Ty) {
285+ Ty = Ty->getUnqualifiedDesugaredType ();
285286 if (isResourceRecordTypeOrArrayOf (Ty))
286287 return true ;
287288 if (Ty->isRecordType ())
288289 return Ty->getAsCXXRecordDecl ()->isEmpty ();
289290 if (Ty->isConstantArrayType () &&
290291 isZeroSizedArray (cast<ConstantArrayType>(Ty)))
291292 return true ;
292- if (Ty->isHLSLBuiltinIntangibleType ())
293+ if (Ty->isHLSLBuiltinIntangibleType () || Ty-> isHLSLAttributedResourceType () )
293294 return true ;
294295 return false ;
295296}
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ cbuffer CB {
7575 groupshared float g2;
7676 // CHECK: VarDecl {{.*}} e2 'hlsl_constant float'
7777 float e2;
78+ // CHECK: VarDecl {{.*}} h2 '__hlsl_resource_t'
79+ __hlsl_resource_t h2;
7880 // CHECK: CXXRecordDecl {{.*}} implicit referenced struct __cblayout_CB_1 definition
7981 // CHECK: PackedAttr
8082 // CHECK-NEXT: FieldDecl {{.*}} a2 'float'
You can’t perform that action at this time.
0 commit comments