Commit a11702e
authored
[SPIRV] Add the derivative group execution mode only on shader types that allow it. (microsoft#7628)
DXC allows user to use decrivative instruction in shader models that do
not allow it, but they must be dead code that will be removed. However,
when we see a derivative instruction in the SPIR-V backend that is not
in a pixel shader we assume it need the DerivativeGroup execution mode,
and we fail when we try to add it to a vertex shader.
To allow out implementation to match DXIL, we will not assume we can add
the execution mode. We will only add it for shader that we know can use
is, and skip the other.
If the derivative instruction is not removed during optimizations, there
will be a validation error.
While fixing this, we observed another bug that is fixed at the same
time since they are closely related. The TaskNV and TaskEXT shader types
do not have the same id, and the SPV_KHR_compute_shader_derivatives does
not work with the NV mesh shader extension. That was fixed up.
Fixes microsoft#74781 parent d751c82 commit a11702e
File tree
4 files changed
+115
-19
lines changed- tools/clang
- lib/SPIRV
- test/CodeGenSPIRV
4 files changed
+115
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4399 | 4399 | | |
4400 | 4400 | | |
4401 | 4401 | | |
4402 | | - | |
4403 | | - | |
4404 | | - | |
| 4402 | + | |
4405 | 4403 | | |
4406 | 4404 | | |
4407 | 4405 | | |
| |||
5780 | 5778 | | |
5781 | 5779 | | |
5782 | 5780 | | |
5783 | | - | |
5784 | | - | |
5785 | | - | |
| 5781 | + | |
5786 | 5782 | | |
5787 | 5783 | | |
5788 | 5784 | | |
| |||
5870 | 5866 | | |
5871 | 5867 | | |
5872 | 5868 | | |
5873 | | - | |
| 5869 | + | |
5874 | 5870 | | |
5875 | | - | |
| 5871 | + | |
5876 | 5872 | | |
5877 | 5873 | | |
5878 | 5874 | | |
| |||
5992 | 5988 | | |
5993 | 5989 | | |
5994 | 5990 | | |
5995 | | - | |
5996 | | - | |
5997 | | - | |
| 5991 | + | |
5998 | 5992 | | |
5999 | 5993 | | |
6000 | 5994 | | |
| |||
6047 | 6041 | | |
6048 | 6042 | | |
6049 | 6043 | | |
6050 | | - | |
6051 | | - | |
6052 | | - | |
| 6044 | + | |
6053 | 6045 | | |
6054 | 6046 | | |
6055 | 6047 | | |
| |||
9782 | 9774 | | |
9783 | 9775 | | |
9784 | 9776 | | |
9785 | | - | |
9786 | | - | |
| 9777 | + | |
9787 | 9778 | | |
9788 | 9779 | | |
9789 | 9780 | | |
| |||
12512 | 12503 | | |
12513 | 12504 | | |
12514 | 12505 | | |
12515 | | - | |
12516 | | - | |
| 12506 | + | |
12517 | 12507 | | |
12518 | 12508 | | |
12519 | 12509 | | |
| |||
15771 | 15761 | | |
15772 | 15762 | | |
15773 | 15763 | | |
| 15764 | + | |
| 15765 | + | |
| 15766 | + | |
| 15767 | + | |
| 15768 | + | |
| 15769 | + | |
| 15770 | + | |
| 15771 | + | |
| 15772 | + | |
| 15773 | + | |
| 15774 | + | |
| 15775 | + | |
| 15776 | + | |
| 15777 | + | |
| 15778 | + | |
| 15779 | + | |
| 15780 | + | |
15774 | 15781 | | |
15775 | | - | |
| 15782 | + | |
| 15783 | + | |
| 15784 | + | |
| 15785 | + | |
| 15786 | + | |
15776 | 15787 | | |
15777 | 15788 | | |
15778 | 15789 | | |
| |||
Lines changed: 28 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 | + | |
Lines changed: 34 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 | + | |
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 | + | |
0 commit comments