[clang] [HLSL] Add codegen for accessing resource members of a struct (PR #187127)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 13:50:22 PDT 2026


================
@@ -5115,18 +5104,20 @@ static void createGlobalResourceDeclForStruct(
       VarDecl::Create(AST, DC, Loc, Loc, Id, ResTy, nullptr, SC_None);
 
   unsigned Range = 1;
-  const HLSLAttributedResourceType *ResHandleTy = nullptr;
-  if (const auto *AT = dyn_cast<ArrayType>(ResTy.getTypePtr())) {
+  const Type *SingleResTy = ResTy.getTypePtr()->getUnqualifiedDesugaredType();
+  while (const auto *AT = dyn_cast<ArrayType>(SingleResTy)) {
----------------
bob80905 wrote:

Would this work for arrays of structs containing members that are arrays of resources? Is that a case we care about in this PR?

https://github.com/llvm/llvm-project/pull/187127


More information about the cfe-commits mailing list