Commit c4a9c64
committed
[HLSL][DirectX] Use a padding type for HLSL buffers.
This change drops the use of the "Layout" type and instead uses explicit
padding throughout the compiler to represent types in HLSL buffers.
There are a few parts to this, though it's difficult to split them up as
they're very interdependent:
1. Refactor HLSLBufferLayoutBuilder to allow us to calculate the padding
of arbitrary types.
2. Teach Clang CodeGen to use HLSL specific paths for cbuffers when
generating aggregate copies, array accesses, and structure accesses.
3. Simplify DXILCBufferAccesses such that it directly replaces accesses
with dx.resource.getpointer rather than recalculating the layout.
4. Basic infrastructure for SPIR-V handling, but the implementation
itself will need work in follow ups.
Fixes several issues, including #138996, #144573, and #156084.
Resolves #147352.1 parent 75ef0be commit c4a9c64
File tree
37 files changed
+972
-1330
lines changed- clang
- lib/CodeGen
- Targets
- test/CodeGenHLSL
- resources
- llvm
- docs/DirectX
- include/llvm/Frontend/HLSL
- lib
- Frontend/HLSL
- IR
- Target
- DirectX
- SPIRV
- test/CodeGen
- DirectX
- CBufferAccess
- SPIRV/hlsl-resources
37 files changed
+972
-1330
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4641 | 4641 | | |
4642 | 4642 | | |
4643 | 4643 | | |
4644 | | - | |
4645 | | - | |
4646 | | - | |
4647 | | - | |
4648 | | - | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
4649 | 4655 | | |
4650 | 4656 | | |
4651 | 4657 | | |
| |||
5110 | 5116 | | |
5111 | 5117 | | |
5112 | 5118 | | |
| 5119 | + | |
| 5120 | + | |
| 5121 | + | |
| 5122 | + | |
| 5123 | + | |
5113 | 5124 | | |
5114 | 5125 | | |
5115 | 5126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2279 | 2279 | | |
2280 | 2280 | | |
2281 | 2281 | | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2282 | 2286 | | |
2283 | 2287 | | |
2284 | 2288 | | |
| |||
0 commit comments