Skip to content

[SPIR-V] Enable vk::ext_extension and vk::ext_capability for variables - #6052

Merged
Cassandra Beckley (cassiebeckley) merged 2 commits into
microsoft:mainfrom
cassiebeckley:inline-spirv-extcap
Nov 23, 2023
Merged

Cassandra Beckley (cassiebeckley) merged 2 commits into
microsoft:mainfrom
cassiebeckley:inline-spirv-extcap

Conversation

@cassiebeckley

Copy link
Copy Markdown
Contributor

ext_extension and ext_capability can only be added to functions at the moment. This PR enables adding them to variable declarations, so that using the variable results in the extensions and capabilities being added to the module. This is useful for the builtin variable syntax proposed in microsoft/hlsl-specs#129.

@github-actions

github-actions Bot commented Nov 21, 2023 •

Copy link
Copy Markdown
Contributor

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 3861c5eef7fde82a7d8beb21c7558b0d3d0c4b7a 120dfe6022e059a3dc7e2a4acff5e2b650a70c2e -- tools/clang/lib/SPIRV/DeclResultIdMapper.cpp tools/clang/lib/SPIRV/SpirvEmitter.cpp tools/clang/lib/SPIRV/SpirvEmitter.h
View the diff from clang-format here.
diff --git a/tools/clang/lib/SPIRV/SpirvEmitter.h b/tools/clang/lib/SPIRV/SpirvEmitter.h
index ac2d93e5..8796ed46 100644
--- a/tools/clang/lib/SPIRV/SpirvEmitter.h
+++ b/tools/clang/lib/SPIRV/SpirvEmitter.h
@@ -106,10 +106,10 @@ public:
 
   /// Create SpirvIntrinsicInstruction for arbitrary SPIR-V instructions
   /// specified by [[vk::ext_instruction(..)]] or [[vk::ext_type_def(..)]]
-  SpirvInstruction *createSpirvIntrInstExt(
-      llvm::ArrayRef<const Attr *> attrs, QualType retType,
-      llvm::ArrayRef<SpirvInstruction *> spvArgs, bool isInstr,
-      SourceLocation loc);
+  SpirvInstruction *
+  createSpirvIntrInstExt(llvm::ArrayRef<const Attr *> attrs, QualType retType,
+                         llvm::ArrayRef<SpirvInstruction *> spvArgs,
+                         bool isInstr, SourceLocation loc);
 
 private:
   void doFunctionDecl(const FunctionDecl *decl);
  • Check this box to apply formatting changes to this branch.

@cassiebeckley
Cassandra Beckley (cassiebeckley) merged commit b32b169 into microsoft:main Nov 23, 2023
@cassiebeckley
Cassandra Beckley (cassiebeckley) deleted the inline-spirv-extcap branch November 23, 2023 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants