[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 15 22:01:22 PDT 2024
================
@@ -1121,6 +1121,11 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
if (Decls[i])
EmitRuntimeCall(Decls[i]);
+ if (getLangOpts().HLSL)
+ if (llvm::Function *ResInitFn =
+ CGM.getHLSLRuntime().createResourceBindingInitFn())
----------------
hekota wrote:
I could not figure out the good way to reflect it in the name, so I have added `needsResourceBindingInitFn` that can be used to check if the init function is needed, and `createResourceBindingInitFn` will always return non-nullptr.
https://github.com/llvm/llvm-project/pull/111207
More information about the cfe-commits
mailing list