''register(ID, space)'' like register(t3, space1) will be translated into
i32 3, i32 1 as the last 2 operands for resource annotation metadata.
NamedMetadata for CBuffers and SRVs are added as "hlsl.srvs" and "hlsl.cbufs".
Paths
| Differential D130951
[HLSL] CodeGen hlsl resource binding. ClosedPublic Authored by python3kgae on Aug 1 2022, 4:42 PM.
Details Summary ''register(ID, space)'' like register(t3, space1) will be translated into NamedMetadata for CBuffers and SRVs are added as "hlsl.srvs" and "hlsl.cbufs".
Diff Detail
Unit TestsFailed
Event Timelinepython3kgae added a parent revision: D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer..Aug 1 2022, 5:01 PM
python3kgae marked an inline comment as done. Comment ActionsRename ResBinding and addResourceAnnotation to BufferResBinding and addBufferResourceAnnotation.
python3kgae added a child revision: D131370: [DirectX backend] Translate cbuffer into DXIL..Aug 8 2022, 1:42 PM python3kgae removed a parent revision: D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer..Oct 12 2022, 9:23 PM Comment Actions Add resource shape to metadata.
python3kgae added a child revision: D136031: [DirectX backend] support ConstantBuffer to DXILResource.h.Oct 15 2022, 7:34 PM
This revision is now accepted and ready to land.Oct 17 2022, 2:20 PM
Closed by commit rG13163dd8abc5: [HLSL] CodeGen hlsl resource binding. (authored by python3kgae). · Explain WhyOct 17 2022, 2:29 PM This revision was automatically updated to reflect the committed changes. python3kgae removed a child revision: D136031: [DirectX backend] support ConstantBuffer to DXILResource.h.Dec 13 2022, 12:56 PM
Revision Contents
Diff 467812 clang/include/clang/Basic/HLSLRuntime.h
clang/lib/CodeGen/CGHLSLRuntime.h
clang/lib/CodeGen/CGHLSLRuntime.cpp
clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl
clang/test/CodeGenHLSL/cbuf.hlsl
llvm/lib/Target/DirectX/DXILResource.h
llvm/lib/Target/DirectX/DXILResource.cpp
llvm/test/CodeGen/DirectX/UAVMetadata.ll
|
If this is only used in the clangCodeGen library, we can move it into libLLVMFrontendHLSL to share instead of keeping them in sync.