Commit 19af858
authored
[HLSL] Constant Buffers CodeGen (llvm#124886)
Translates `cbuffer` declaration blocks to `target("dx.CBuffer")` type. Creates global variables in `hlsl_constant` address space for all `cbuffer` constant and adds metadata describing which global constant belongs to which constant buffer. For explicit constant buffer layout information an explicit layout type `target("dx.Layout")` is used. This might change in the future.
The constant globals are temporary and will be removed in upcoming pass that will translate `load` instructions in the `hlsl_constant` address space to constant buffer load intrinsics calls off a CBV handle (llvm#124630, llvm#112992).
See [Constant buffer design
doc](llvm/wg-hlsl#94) for more details.
Fixes llvm#113514, llvm#1065961 parent 2a7d3f0 commit 19af858
File tree
20 files changed
+871
-239
lines changed- clang
- include/clang/AST
- lib
- AST
- CodeGen
- Targets
- Sema
- test/CodeGenHLSL
20 files changed
+871
-239
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5039 | 5039 | | |
5040 | 5040 | | |
5041 | 5041 | | |
| 5042 | + | |
| 5043 | + | |
| 5044 | + | |
| 5045 | + | |
| 5046 | + | |
5042 | 5047 | | |
5043 | 5048 | | |
5044 | 5049 | | |
| |||
5059 | 5064 | | |
5060 | 5065 | | |
5061 | 5066 | | |
| 5067 | + | |
| 5068 | + | |
| 5069 | + | |
| 5070 | + | |
5062 | 5071 | | |
5063 | 5072 | | |
5064 | 5073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6266 | 6266 | | |
6267 | 6267 | | |
6268 | 6268 | | |
6269 | | - | |
6270 | | - | |
| 6269 | + | |
| 6270 | + | |
6271 | 6271 | | |
6272 | 6272 | | |
6273 | 6273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1747 | 1747 | | |
1748 | 1748 | | |
1749 | 1749 | | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1750 | 1754 | | |
1751 | 1755 | | |
1752 | 1756 | | |
| |||
5717 | 5721 | | |
5718 | 5722 | | |
5719 | 5723 | | |
5720 | | - | |
| 5724 | + | |
5721 | 5725 | | |
5722 | 5726 | | |
5723 | 5727 | | |
| |||
5747 | 5751 | | |
5748 | 5752 | | |
5749 | 5753 | | |
| 5754 | + | |
| 5755 | + | |
| 5756 | + | |
| 5757 | + | |
| 5758 | + | |
| 5759 | + | |
5750 | 5760 | | |
5751 | 5761 | | |
5752 | 5762 | | |
| |||
0 commit comments