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) {
285
285
// array, or a builtin intangible type. Returns false it is a valid leaf element
286
286
// type or if it is a record type that needs to be inspected further.
287
287
static bool isInvalidConstantBufferLeafElementType (const Type *Ty) {
288
+ Ty = Ty->getUnqualifiedDesugaredType ();
288
289
if (isResourceRecordTypeOrArrayOf (Ty))
289
290
return true ;
290
291
if (Ty->isRecordType ())
291
292
return Ty->getAsCXXRecordDecl ()->isEmpty ();
292
293
if (Ty->isConstantArrayType () &&
293
294
isZeroSizedArray (cast<ConstantArrayType>(Ty)))
294
295
return true ;
295
- if (Ty->isHLSLBuiltinIntangibleType ())
296
+ if (Ty->isHLSLBuiltinIntangibleType () || Ty-> isHLSLAttributedResourceType () )
296
297
return true ;
297
298
return false ;
298
299
}
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