Commit df0287c
authored
[SPIRV] Implement SM6.6 implicit LOD operations in compute shaders (microsoft#5829)
SPIRV has not yet implemented the changes in SM6.6 that allows
[derivatives
in compute, mesh, and amplification
shaders](https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_Derivatives.html).
This is because there is no KHR
extension that enabled that capability in SPIR-V.
However, we have decided to use
[SPV_NV_compute_shader_derivatives](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_compute_shader_derivatives.asciidoc)
to implement it for compute shader while we wait for a KHR extension.
This change only deals with the texture sample instructions.
The changes involve
1. modifying code that makes sure these only appear in fragment shaders
to allow compute shaders as well.
1. add the extension and capability
1. set the correct execution mode on the function when
the intrinsics are used in compute shaders.1 parent 3ac44bc commit df0287c
File tree
18 files changed
+309
-9
lines changed- external
- tools/clang
- include/clang/SPIRV
- lib/SPIRV
- test/CodeGenSPIRV_Lit
18 files changed
+309
-9
lines changedSubmodule SPIRV-Tools updated 15 files
- .github/workflows/autoroll.yml+1-1
- .github/workflows/bazel.yml+1-1
- .github/workflows/release.yml+1-1
- .github/workflows/scorecard.yml+4-4
- .github/workflows/wasm.yml+1-1
- DEPS+3-3
- source/opt/aggressive_dead_code_elim_pass.cpp+4
- source/opt/fix_storage_class.cpp+7-1
- source/opt/local_access_chain_convert_pass.cpp+2-1
- source/opt/local_single_block_elim_pass.cpp+2-1
- source/opt/local_single_store_elim_pass.cpp+2-1
- source/opt/trim_capabilities_pass.h+3-1
- test/opt/fix_storage_class_test.cpp+41
- test/opt/trim_capabilities_pass_test.cpp+57
- utils/update_build_version.py+3-2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
879 | 886 | | |
880 | 887 | | |
881 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| |||
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| 267 | + | |
| 268 | + | |
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4084 | 4084 | | |
4085 | 4085 | | |
4086 | 4086 | | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
4087 | 4090 | | |
4088 | 4091 | | |
4089 | 4092 | | |
| |||
5305 | 5308 | | |
5306 | 5309 | | |
5307 | 5310 | | |
5308 | | - | |
5309 | | - | |
5310 | | - | |
| 5311 | + | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
5311 | 5315 | | |
5312 | 5316 | | |
5313 | 5317 | | |
| |||
5384 | 5388 | | |
5385 | 5389 | | |
5386 | 5390 | | |
| 5391 | + | |
| 5392 | + | |
| 5393 | + | |
5387 | 5394 | | |
5388 | 5395 | | |
5389 | 5396 | | |
| |||
5471 | 5478 | | |
5472 | 5479 | | |
5473 | 5480 | | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
5474 | 5484 | | |
5475 | 5485 | | |
5476 | 5486 | | |
| |||
5620 | 5630 | | |
5621 | 5631 | | |
5622 | 5632 | | |
| 5633 | + | |
| 5634 | + | |
| 5635 | + | |
| 5636 | + | |
5623 | 5637 | | |
5624 | 5638 | | |
5625 | 5639 | | |
| |||
14074 | 14088 | | |
14075 | 14089 | | |
14076 | 14090 | | |
| 14091 | + | |
| 14092 | + | |
| 14093 | + | |
| 14094 | + | |
| 14095 | + | |
| 14096 | + | |
| 14097 | + | |
| 14098 | + | |
| 14099 | + | |
| 14100 | + | |
| 14101 | + | |
| 14102 | + | |
| 14103 | + | |
| 14104 | + | |
| 14105 | + | |
| 14106 | + | |
| 14107 | + | |
| 14108 | + | |
| 14109 | + | |
| 14110 | + | |
| 14111 | + | |
| 14112 | + | |
| 14113 | + | |
| 14114 | + | |
| 14115 | + | |
| 14116 | + | |
| 14117 | + | |
14077 | 14118 | | |
14078 | 14119 | | |
14079 | 14120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1219 | 1219 | | |
1220 | 1220 | | |
1221 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1222 | 1229 | | |
1223 | 1230 | | |
1224 | 1231 | | |
| |||
Lines changed: 26 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 | + | |
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: 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: 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 | + | |
0 commit comments