Commit 94bde8c
authored
Introduces `__builtin_hlsl_buffer_update_counter` clang buildin that is
used to implement the `IncrementCounter` and `DecrementCounter` methods
on `RWStructuredBuffer` and `RasterizerOrderedStructuredBuffer` (see
Note).
The builtin is translated to LLVM intrisic `llvm.dx.bufferUpdateCounter`
or `llvm.spv.bufferUpdateCounter`.
Introduces `BuiltinTypeMethodBuilder` helper in `HLSLExternalSemaSource`
that enables adding methods to builtin types using builder pattern like
this:
```
BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName", ReturnType)
.addParam("param_name", Type, InOutModifier)
.callBuiltin("buildin_name", { BuiltinParams })
.finalizeMethod();
```
Fixes #113513
1 parent 1944d19 commit 94bde8c
File tree
14 files changed
+534
-96
lines changed- clang
- include/clang/Basic
- lib
- CodeGen
- Sema
- test
- AST/HLSL
- CodeGenHLSL/builtins
- SemaHLSL/BuiltIns
- llvm
- include/llvm/IR
- lib/Target/DirectX
14 files changed
+534
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4882 | 4882 | | |
4883 | 4883 | | |
4884 | 4884 | | |
4885 | | - | |
4886 | 4885 | | |
4887 | 4886 | | |
4888 | 4887 | | |
| |||
4907 | 4906 | | |
4908 | 4907 | | |
4909 | 4908 | | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
4910 | 4915 | | |
4911 | 4916 | | |
4912 | 4917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7287 | 7287 | | |
7288 | 7288 | | |
7289 | 7289 | | |
| 7290 | + | |
| 7291 | + | |
7290 | 7292 | | |
7291 | 7293 | | |
7292 | 7294 | | |
| |||
12528 | 12530 | | |
12529 | 12531 | | |
12530 | 12532 | | |
| 12533 | + | |
| 12534 | + | |
| 12535 | + | |
| 12536 | + | |
12531 | 12537 | | |
12532 | 12538 | | |
12533 | 12539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19409 | 19409 | | |
19410 | 19410 | | |
19411 | 19411 | | |
| 19412 | + | |
| 19413 | + | |
| 19414 | + | |
| 19415 | + | |
| 19416 | + | |
| 19417 | + | |
| 19418 | + | |
| 19419 | + | |
| 19420 | + | |
19412 | 19421 | | |
19413 | 19422 | | |
19414 | 19423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
0 commit comments