Commit d7ee5e1
authored
[spirv] set needsLegalization as true when variable offset is found (#3820)
When we find a variable offset used for the texture sampling, we have to
- Run legalization if `-fcgl` is not enabled.
- Enable `--before-legalize-hlsl` for spirv-val if `-fcgl` is enabled.
to match the behavior of the DXIL backend.
In order to do that, we set SpirvEmitter::needsLegalization as true when
we find a variable offset used for the texture sampling. SpirvEmitter
will determine enabling `--before-legalize-hlsl` or running the
legalization depending on `-fcgl`.1 parent cef61b5 commit d7ee5e1
5 files changed
Lines changed: 87 additions & 0 deletions
File tree
- tools/clang
- lib/SPIRV
- test/CodeGenSPIRV
- unittests/SPIRV
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4461 | 4461 | | |
4462 | 4462 | | |
4463 | 4463 | | |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
4464 | 4467 | | |
4465 | 4468 | | |
4466 | 4469 | | |
| |||
4893 | 4896 | | |
4894 | 4897 | | |
4895 | 4898 | | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
4896 | 4902 | | |
4897 | 4903 | | |
4898 | 4904 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
983 | 994 | | |
984 | 995 | | |
985 | 996 | | |
| |||
0 commit comments