[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 10:02:53 PDT 2025


================
@@ -554,6 +554,19 @@ static void initializeBufferFromBinding(CodeGenModule &CGM,
                    Args);
 }
 
+void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
+                                              llvm::GlobalVariable *GV) {
+  if (auto Attr = VD->getAttr<HLSLVkExtBuiltinInputAttr>()) {
+    LLVMContext &Ctx = GV->getContext();
+    IRBuilder<> B(GV->getContext());
+    MDNode *Operands = MDNode::get(
+        Ctx, {ConstantAsMetadata::get(B.getInt32(11)),
----------------
Keenuts wrote:

Will do (11 is the `Spirv::Decoration::Builtin` operand)

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


More information about the llvm-commits mailing list