aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Targets/AMDGPU.cpp
diff options
context:
space:
mode:
authorNathan Gauër <brioche@google.com>2025-06-04 13:22:37 +0200
committerGitHub <noreply@github.com>2025-06-04 13:22:37 +0200
commit20d70196c9a4da344d0944f3c78447c3bd7079c7 (patch)
tree2644223d4591f05c1b8d9efda4a7a17fff976fca /clang/lib/Basic/Targets/AMDGPU.cpp
parentd7c7c461f5216c2aa1e8f0d884464daf9bcb9ecb (diff)
downloadllvm-20d70196c9a4da344d0944f3c78447c3bd7079c7.zip
llvm-20d70196c9a4da344d0944f3c78447c3bd7079c7.tar.gz
llvm-20d70196c9a4da344d0944f3c78447c3bd7079c7.tar.bz2
[HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (#138530)
This variable attribute is used in HLSL to add Vulkan specific builtins in a shader. The attribute is documented here: https://github.com/microsoft/hlsl-specs/blob/17727e88fd1cb09013cb3a144110826af05f4dd5/proposals/0011-inline-spirv.md Those variable, even if marked as `static` are externally initialized by the pipeline/driver/GPU. This is handled by moving them to a specific address space `hlsl_input`, also added by this commit. The design for input variables in Clang can be found here: https://github.com/llvm/wg-hlsl/blob/355771361ef69259fef39a65caef8bff9cb4046d/proposals/0019-spirv-input-builtin.md Co-authored-by: Justin Bogner <mail@justinbogner.com>
Diffstat (limited to 'clang/lib/Basic/Targets/AMDGPU.cpp')
-rw-r--r--clang/lib/Basic/Targets/AMDGPU.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp b/clang/lib/Basic/Targets/AMDGPU.cpp
index 9a595c5..8d5489b 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -62,6 +62,7 @@ const LangASMap AMDGPUTargetInfo::AMDGPUDefIsGenMap = {
// will break loudly.
llvm::AMDGPUAS::PRIVATE_ADDRESS, // hlsl_private
llvm::AMDGPUAS::GLOBAL_ADDRESS, // hlsl_device
+ llvm::AMDGPUAS::PRIVATE_ADDRESS, // hlsl_input
};
const LangASMap AMDGPUTargetInfo::AMDGPUDefIsPrivMap = {
@@ -89,6 +90,7 @@ const LangASMap AMDGPUTargetInfo::AMDGPUDefIsPrivMap = {
llvm::AMDGPUAS::CONSTANT_ADDRESS, // hlsl_constant
llvm::AMDGPUAS::PRIVATE_ADDRESS, // hlsl_private
llvm::AMDGPUAS::GLOBAL_ADDRESS, // hlsl_device
+ llvm::AMDGPUAS::PRIVATE_ADDRESS, // hlsl_input
};
} // namespace targets
} // namespace clang