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 @@ -285,14 +285,15 @@ static bool isResourceRecordTypeOrArrayOf(const Type *Ty) {
285285// array, or a builtin intangible type. Returns false it is a valid leaf element
286286// type or if it is a record type that needs to be inspected further.
287287static bool isInvalidConstantBufferLeafElementType (const Type *Ty) {
288+ Ty = Ty->getUnqualifiedDesugaredType ();
288289 if (isResourceRecordTypeOrArrayOf (Ty))
289290 return true ;
290291 if (Ty->isRecordType ())
291292 return Ty->getAsCXXRecordDecl ()->isEmpty ();
292293 if (Ty->isConstantArrayType () &&
293294 isZeroSizedArray (cast<ConstantArrayType>(Ty)))
294295 return true ;
295- if (Ty->isHLSLBuiltinIntangibleType ())
296+ if (Ty->isHLSLBuiltinIntangibleType () || Ty-> isHLSLAttributedResourceType () )
296297 return true ;
297298 return false ;
298299}
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