Commit a3a7d93
[SPIR-V] Use
Currently, the spir-v validator fails if `OpImageRead` instruction is
used when loading from read-only `Buffer`.
### Unit Test
```hlsl
RWBuffer<uint> rwbuff;
Buffer<uint> buff;
[numthreads(1,1,1)]
void main() {
rwbuff[99] = buff[98];
rwbuff[97] = rwbuff[96];
}
```
This also unblocks adding a test case that adds a special capability
when using a non-uniform index on `Buffer` arrays.
(llvm#162540).
Resolves llvm#162891OpImageFetch instead of OpImageRead when loading from read-only Buffer resource. (llvm#163626)1 parent bed857e commit a3a7d93
File tree
2 files changed
+72
-21
lines changed- llvm
- lib/Target/SPIRV
- test/CodeGen/SPIRV/hlsl-resources
2 files changed
+72
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
1325 | | - | |
| 1324 | + | |
| 1325 | + | |
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| |||
3639 | 3639 | | |
3640 | 3640 | | |
3641 | 3641 | | |
3642 | | - | |
| 3642 | + | |
| 3643 | + | |
3643 | 3644 | | |
3644 | 3645 | | |
3645 | | - | |
3646 | | - | |
3647 | | - | |
3648 | | - | |
3649 | | - | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
3650 | 3649 | | |
3651 | 3650 | | |
3652 | 3651 | | |
| 3652 | + | |
3653 | 3653 | | |
3654 | 3654 | | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
3655 | 3659 | | |
3656 | 3660 | | |
3657 | 3661 | | |
3658 | | - | |
3659 | | - | |
3660 | | - | |
3661 | | - | |
3662 | | - | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
3663 | 3669 | | |
3664 | 3670 | | |
3665 | 3671 | | |
| |||
3668 | 3674 | | |
3669 | 3675 | | |
3670 | 3676 | | |
3671 | | - | |
3672 | | - | |
3673 | | - | |
3674 | | - | |
3675 | | - | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
3676 | 3684 | | |
3677 | 3685 | | |
3678 | 3686 | | |
| |||
Lines changed: 43 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments