[PATCH] D130951: [HLSL] CodeGen hlsl resource binding.

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 14:22:22 PDT 2022


python3kgae added inline comments.


================
Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:73
   CodeGenModule &CGM;
   uint32_t ResourceCounters[static_cast<uint32_t>(
       hlsl::ResourceClass::NumClasses)] = {0};
----------------
beanz wrote:
> The `ResourceCounters` here was a stand-in for allocating resource indices.
> 
> If you have a different path for allocating these, we shouldn't need the counter anymore. I'm a little concerned that it looks like you're not allocating these in code generation. Can you explain how you intend to allocate indices? Is there a reason not to do this in code gen?
The reason not to do it in codeGen is that we have to remove unused global resources even in Od and update the ID in the backend.

The plan is to allocate the ID after unused global resources are deleted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130951/new/

https://reviews.llvm.org/D130951



More information about the cfe-commits mailing list