SPIRV-Tools/include/spirv-tools
Jaebaek Seo d997c83b10
Add spirv-opt pass to replace descriptor accesses based on variable indices (#4574)
This commit adds a spirv-opt pass to replace accesses to
descriptor array based on variable indices with constant
elements.

Before:
```
%descriptor = OpVariable %_ptr_array_Image Uniform
...
%ac = OpAccessChain %_ptr_Image %descriptor %variable_index
(some image instructions using %ac)
```
After:
```
%descriptor = OpVariable %_ptr_array_Image Uniform
...
OpSwitch %variable_index 0 %case0 1 %case1 ...
...
%case0 = OpLabel
%ac = OpAccessChain %_ptr_Image %descriptor %uint_0
...
%case1 = OpLabel
%ac = OpAccessChain %_ptr_Image %descriptor %uint_1
...
(use OpPhi for value with concrete type)
```
2021-10-26 17:20:58 -04:00
..
instrument.hpp Add kInstErrorMax to instrument.hpp (#4315) 2021-06-07 08:06:10 -04:00
libspirv.h Include a maximum value for spv_target_env (#4559) 2021-10-06 14:50:12 +00:00
libspirv.hpp Add a feature for allowing LocalSizeId (#4492) 2021-08-26 14:33:19 -04:00
linker.hpp Rewrite include guards (#1793) 2018-08-03 08:05:33 -04:00
linter.hpp spirv-lint: Add lint based on divergence analysis (#4488) 2021-08-27 14:43:23 -04:00
optimizer.hpp Add spirv-opt pass to replace descriptor accesses based on variable indices (#4574) 2021-10-26 17:20:58 -04:00