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) {
282
282
// array, or a builtin intangible type. Returns false it is a valid leaf element
283
283
// type or if it is a record type that needs to be inspected further.
284
284
static bool isInvalidConstantBufferLeafElementType (const Type *Ty) {
285
+ Ty = Ty->getUnqualifiedDesugaredType ();
285
286
if (isResourceRecordTypeOrArrayOf (Ty))
286
287
return true ;
287
288
if (Ty->isRecordType ())
288
289
return Ty->getAsCXXRecordDecl ()->isEmpty ();
289
290
if (Ty->isConstantArrayType () &&
290
291
isZeroSizedArray (cast<ConstantArrayType>(Ty)))
291
292
return true ;
292
- if (Ty->isHLSLBuiltinIntangibleType ())
293
+ if (Ty->isHLSLBuiltinIntangibleType () || Ty-> isHLSLAttributedResourceType () )
293
294
return true ;
294
295
return false ;
295
296
}
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ cbuffer CB {
75
75
groupshared float g2;
76
76
// CHECK: VarDecl {{.*}} e2 'hlsl_constant float'
77
77
float e2;
78
+ // CHECK: VarDecl {{.*}} h2 '__hlsl_resource_t'
79
+ __hlsl_resource_t h2;
78
80
// CHECK: CXXRecordDecl {{.*}} implicit referenced struct __cblayout_CB_1 definition
79
81
// CHECK: PackedAttr
80
82
// CHECK-NEXT: FieldDecl {{.*}} a2 'float'
You can’t perform that action at this time.
0 commit comments